> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AWS RDS Demo

> Step-by-step guide to deploying, configuring, and connecting to a managed PostgreSQL instance on Amazon RDS, covering instance creation, storage, networking, security, backups, and client connections.

In this lesson you'll learn how to deploy a managed PostgreSQL instance using Amazon RDS. RDS removes the need to provision and operate the underlying database server by handling instance provisioning, storage management, automated backups, and other operational tasks.

## 1. Create Database (Standard vs Easy)

Open the AWS Management Console, search for **RDS**, and choose **Create database**. You can pick:

* **Easy (Simple) create** — applies opinionated defaults and speeds up creation.
* **Standard create** — exposes all configuration options for full control.

For this walkthrough we use **Standard create** so you can see the available configuration settings.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/mmZ8on_4m7GGxSVn/images/Introduction-to-AWS-Databases/AWS-Databases-Part-1/AWS-RDS-Demo/aws-rds-create-database-engine-options.jpg?fit=max&auto=format&n=mmZ8on_4m7GGxSVn&q=85&s=36e0d120b7ef1eeabf177d31922f1ee6" alt="A screenshot of the AWS RDS &#x22;Create database&#x22; console showing the database creation method (Standard vs Easy) and engine options. The engine tiles visible include Aurora (MySQL/PostgreSQL compatible), MySQL, MariaDB, PostgreSQL and Oracle." width="1920" height="1080" data-path="images/Introduction-to-AWS-Databases/AWS-Databases-Part-1/AWS-RDS-Demo/aws-rds-create-database-engine-options.jpg" />
</Frame>

## 2. Engine selection and version

Select the database engine you want — choose **PostgreSQL** for a Postgres instance. Then select the engine version; the default is suitable in most cases unless you need a specific release for compatibility or features.

## 3. Templates and intended use

RDS offers templates that preconfigure many settings:

| Template   | Use case                                | Key differences                                                     |
| ---------- | --------------------------------------- | ------------------------------------------------------------------- |
| Production | Critical workloads                      | Enables Multi-AZ, higher availability and resilience                |
| Dev/Test   | Development and experimentation         | Balanced defaults for cost and function                             |
| Free tier  | New accounts / cost-constrained testing | Uses settings that may qualify for the AWS Free Tier (if available) |

Select the template that matches your workload — we used **Dev/Test** for this lesson.

## 4. Instance configuration (compute)

RDS instances run on instance classes that resemble EC2 types. Pick an instance class that matches your CPU, memory, and network requirements — the console shows vCPU, RAM, and network throughput for each option.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/mmZ8on_4m7GGxSVn/images/Introduction-to-AWS-Databases/AWS-Databases-Part-1/AWS-RDS-Demo/aws-rds-instance-classes-dropdown.jpg?fit=max&auto=format&n=mmZ8on_4m7GGxSVn&q=85&s=b5b3dcdecae804532d25fff64ac1b138" alt="A screenshot of a cloud console dropdown showing database instance classes (e.g., db.m6i.large, db.m6i.xlarge) with their vCPU counts, RAM sizes and network Mbps values. It appears to be an AWS RDS instance type selection panel." width="1920" height="1080" data-path="images/Introduction-to-AWS-Databases/AWS-Databases-Part-1/AWS-RDS-Demo/aws-rds-instance-classes-dropdown.jpg" />
</Frame>

## 5. Storage

Choose a storage type and the initial size. You can enable storage autoscaling so RDS grows storage as required up to a maximum you define. Storage options (General Purpose SSD, Provisioned IOPS, etc.) vary by cost and performance.

| Storage type               | Best for                           |
| -------------------------- | ---------------------------------- |
| General Purpose (gp2/gp3)  | General workloads, cost-effective  |
| Provisioned IOPS (io1/io2) | I/O-intensive production databases |

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/mmZ8on_4m7GGxSVn/images/Introduction-to-AWS-Databases/AWS-Databases-Part-1/AWS-RDS-Demo/rds-io1-100gib-3000iops-autoscaling.jpg?fit=max&auto=format&n=mmZ8on_4m7GGxSVn&q=85&s=5db3ea6d07a99d8656c51cfa3f001065" alt="A cloud database storage settings panel (likely AWS RDS) showing &#x22;Provisioned IOPS SSD (io1)&#x22; with 100 GiB allocated storage, 3000 provisioned IOPS, and storage autoscaling enabled with a 1000 GiB max threshold." width="1920" height="1080" data-path="images/Introduction-to-AWS-Databases/AWS-Databases-Part-1/AWS-RDS-Demo/rds-io1-100gib-3000iops-autoscaling.jpg" />
</Frame>

Tip: For workloads with unpredictable growth, enable storage autoscaling and set a sensible maximum to avoid unexpected costs.

## 6. Connectivity, networking, and optional compute helper

Decide whether to provision an associated compute resource for quick connectivity tests (optional). Choose the VPC and subnets where the DB instance should run — you can use the default VPC or supply a custom network.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/mmZ8on_4m7GGxSVn/images/Introduction-to-AWS-Databases/AWS-Databases-Part-1/AWS-RDS-Demo/aws-rds-setup-compute-network-ipv4.jpg?fit=max&auto=format&n=mmZ8on_4m7GGxSVn&q=85&s=d23314746869081e5244911d24a91bf5" alt="A screenshot of an AWS RDS setup page showing compute and network settings with &#x22;Don't connect to an EC2 compute resource&#x22; and &#x22;IPv4&#x22; selected. It also displays the Virtual Private Cloud (Default VPC), DB subnet group, and Public access options." width="1920" height="1080" data-path="images/Introduction-to-AWS-Databases/AWS-Databases-Part-1/AWS-RDS-Demo/aws-rds-setup-compute-network-ipv4.jpg" />
</Frame>

* Set **Public access** to `No` for production (keeps the instance in private subnets). Set to `Yes` only for temporary testing and ensure strong security rules.
* Choose a DB subnet group and optionally specify an Availability Zone or leave it as **No preference** for AWS to pick.

## 7. Security groups and public access

Create or reuse a security group to control inbound traffic. For local testing, add a rule to allow your client IP on the PostgreSQL port (`5432` by default). For production, restrict access to known application subnets or a bastion host.

## 8. Additional configuration

Under Additional configuration you can:

* Change the default port (`5432`).
* Select authentication methods (password, `IAM` authentication).
* Enable enhanced monitoring, performance insights, backups, encryption, and set backup retention windows.

RDS automated backups and point-in-time recovery simplify restores.

When ready, click **Create database**. Provisioning typically takes several minutes while AWS provisions compute, storage, and networking.

## 9. Instance available — find connectivity details

After the instance status changes to **Available**, open the DB instance details. Note the `Endpoint` (host) and `Port` — you'll use these, together with the master username and password, to connect from a client.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/mmZ8on_4m7GGxSVn/images/Introduction-to-AWS-Databases/AWS-Databases-Part-1/AWS-RDS-Demo/rds-console-postgres-my-first-db.jpg?fit=max&auto=format&n=mmZ8on_4m7GGxSVn&q=85&s=134ee0b9786a777d7d26ad411abd560a" alt="A screenshot of the Amazon RDS console showing a PostgreSQL DB instance summary (my-first-db) with CPU/status info. The page displays connectivity and security details including endpoint, port, VPC/subnets, and security group." width="1920" height="1080" data-path="images/Introduction-to-AWS-Databases/AWS-Databases-Part-1/AWS-RDS-Demo/rds-console-postgres-my-first-db.jpg" />
</Frame>

Example connection using psql:

* `psql -h <your-rds-endpoint> -U postgres -p 5432 -d postgres`

Replace `<your-rds-endpoint>` with the value shown in the console.

## 10. Connect using pgAdmin

You can connect with GUI tools such as pgAdmin. Create a new server entry and supply:

* Host: the RDS endpoint (paste from the console)
* Port: `5432` (or your custom port)
* Maintenance DB: typically `postgres`
* Username: the master username (e.g., `postgres`)
* Password: the password you set

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/mmZ8on_4m7GGxSVn/images/Introduction-to-AWS-Databases/AWS-Databases-Part-1/AWS-RDS-Demo/pgadmin-create-server-connection-rds-5432.jpg?fit=max&auto=format&n=mmZ8on_4m7GGxSVn&q=85&s=142864578a5a350c36bb6401bc6bb4a9" alt="A screenshot of the pgAdmin &#x22;Create - Server&#x22; dialog on the Connection tab, showing an Amazon RDS host endpoint, port 5432, maintenance database and username set to &#x22;postgres,&#x22; and an empty password field. The pgAdmin dashboard with welcome/configure tiles is visible in the background and Cancel/Reset/Save buttons appear at the bottom." width="1920" height="1080" data-path="images/Introduction-to-AWS-Databases/AWS-Databases-Part-1/AWS-RDS-Demo/pgadmin-create-server-connection-rds-5432.jpg" />
</Frame>

After you save, pgAdmin will show the server and default database. You can create new databases, schemas, tables, and run queries as usual.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/mmZ8on_4m7GGxSVn/images/Introduction-to-AWS-Databases/AWS-Databases-Part-1/AWS-RDS-Demo/pgadmin-my-app-dashboard-metrics-activity.jpg?fit=max&auto=format&n=mmZ8on_4m7GGxSVn&q=85&s=327d708e487909e889ecec9ca00d1202" alt="A screenshot of the pgAdmin database dashboard with the server/database tree on the left and the &#x22;my_app&#x22; database selected. The right side shows metrics panels (sessions, transactions/sec, tuples in/out, block I/O) and a server activity table at the bottom." width="1920" height="1080" data-path="images/Introduction-to-AWS-Databases/AWS-Databases-Part-1/AWS-RDS-Demo/pgadmin-my-app-dashboard-metrics-activity.jpg" />
</Frame>

<Callout icon="lightbulb" color="#1CB2FE">
  Do not use the master account credentials for application connections. Create an application-specific database user with the minimum required privileges. For production, use `IAM` authentication or a secrets manager such as [AWS Secrets Manager](https://aws.amazon.com/secrets-manager/) to store and rotate credentials securely.
</Callout>

## 11. Modify or delete the instance

* To change instance settings later, choose **Modify** in the RDS console to update instance class, storage, backup windows, maintenance windows, and more.
* To remove the instance, choose **Delete**. The console will prompt whether to create a final snapshot and whether to retain automated backups — for production systems, create and retain snapshots or export data before deletion.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/mmZ8on_4m7GGxSVn/images/Introduction-to-AWS-Databases/AWS-Databases-Part-1/AWS-RDS-Demo/amazon-rds-my-first-db-connectivity.jpg?fit=max&auto=format&n=mmZ8on_4m7GGxSVn&q=85&s=db138c3b91aa1f6d464c7b79a0b5f7a3" alt="Screenshot of the Amazon RDS console for a database named &#x22;my-first-db.&#x22; It shows the instance summary (CPU, status &#x22;Available&#x22;, PostgreSQL engine) and the Connectivity & security section with endpoint, port and VPC/subnet details." width="1920" height="1080" data-path="images/Introduction-to-AWS-Databases/AWS-Databases-Part-1/AWS-RDS-Demo/amazon-rds-my-first-db-connectivity.jpg" />
</Frame>

<Callout icon="warning" color="#FF6B6B">
  If you enable public access, ensure your security group only allows trusted IP addresses on the database port. Exposing a database to the public internet without strict controls increases the risk of unauthorized access.
</Callout>

If you choose **Delete**, confirm the deletion checkbox(s) and acknowledge the prompt to remove the instance and any retained snapshots (depending on your choices).

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/mmZ8on_4m7GGxSVn/images/Introduction-to-AWS-Databases/AWS-Databases-Part-1/AWS-RDS-Demo/my-first-db-delete-confirmation.jpg?fit=max&auto=format&n=mmZ8on_4m7GGxSVn&q=85&s=a401adf181c305e6e92a0ce27e52c9b4" alt="A confirmation dialog for deleting the &#x22;my-first-db&#x22; database instance with checkboxes to create a final snapshot, retain automated backups, and an acknowledgment. There’s an input field partially filled to confirm deletion and Cancel/Delete buttons at the bottom." width="1920" height="1080" data-path="images/Introduction-to-AWS-Databases/AWS-Databases-Part-1/AWS-RDS-Demo/my-first-db-delete-confirmation.jpg" />
</Frame>

That concludes this lesson on deploying and connecting to a PostgreSQL instance on Amazon RDS.

## References

* [Amazon RDS Documentation](https://docs.aws.amazon.com/rds/)
* [PostgreSQL Official Site](https://www.postgresql.org/)
* [pgAdmin](https://www.pgadmin.org/)

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/introduction-to-aws-databases/module/001734a9-f7c2-4943-83a3-d64621fedfd2/lesson/dbb798b2-1272-4fd7-9384-41e371499a97" />

  <Card title="Practice Lab" icon="flask-conical" cta="Learn more" href="https://learn.kodekloud.com/user/courses/introduction-to-aws-databases/module/001734a9-f7c2-4943-83a3-d64621fedfd2/lesson/c10c0f10-c2d5-4117-aa57-6f70ff667ea7" />
</CardGroup>
