# Creating the RDS instance for PostgreSQL using the IAM Authentication

**URL:** <https://community.cdata.com/t/creating-the-rds-instance-for-postgresql-using-the-iam-authentication/701>\
**Category:** Getting started\
**Tags:** article\
**Created:** [April 25, 2024, 2:47pm UTC](https://community.cdata.com/t/creating-the-rds-instance-for-postgresql-using-the-iam-authentication/701 "2024-04-25T14:47:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prateek\_Jain](https://avatars.discourse-cdn.com/v4/letter/p/85e7bf/32.png) [@Prateek\_Jain](https://community.cdata.com/u/Prateek_Jain)\
**Post date:** [April 25, 2024, 2:47pm UTC](https://community.cdata.com/t/creating-the-rds-instance-for-postgresql-using-the-iam-authentication/701/1 "2024-04-25T14:47:12Z")

</div>

In cloud computing, managing databases efficiently and securely is paramount. One such method involves creating an Amazon RDS instance for PostgreSQL using IAM Authentication. This process allows users to leverage the robustness of PostgreSQL databases while ensuring secure access through AWS’s Identity and Access Management (IAM) system. This approach enhances security and simplifies database management, making it an attractive option for businesses and developers alike.

[CData Sync](https://www.cdata.com/sync/) simplifies the process of replicating data into your RDS PostgreSQL instance while adhering to the security best practices of IAM authentication. Meanwhile, [CData Drivers](https://www.cdata.com/drivers/) ensure that your applications can communicate seamlessly with this database, allowing you to read, write, and update data.

In the upcoming sections, we’ll explore a step-by-step guide for configuring an RDS instance for PostgreSQL using IAM Authentication:

1. Creating the RDS Instance
2. Creating the PostgreSQL user in pgAdmin.
3. Creating an IAM role
4. Configuration of PostgreSQL in Sync and Drivers

## **Step 1: Creating the RDS Instance** &nbsp;

This is the first step where an Amazon RDS instance for PostgreSQL is set up in AWS. The RDS instance acts as your database on the cloud, which can be accessed and managed remotely.

1. Log in to your AWS instance, then navigate to RDS. Once there, open the Databases section and click on ‘Create Database’.

2. Configure the Databases with the following properties:

- Select the ‘Standard’ database creation method.

- Choose the ‘PostgreSQL’ engine option.

- Choose either the Dev/Test template or the Free Tier template, depending on the cost.

1. Configure the Settings to:

- **DB instance identifier** : Name your RDS instance
- **Master username** : Name your database
- **Master password** : Choose the password for your database
- **Confirm master password**  
 ![-I48rh4T0keo-5GsTU4qYst5neNELCaRAuObfz7A65hPMVygbkDQs8MMySrWGAiYnhEEidTdyvaK-EdG_bkSFUKBGI5YTNDfecrfleTzSj84sguSO03yHz9MSq6FM0G2jUKp7UgE9m3Y7nHUc9wnF7A](https://us1.discourse-cdn.com/cdata/original/2X/7/77f70e52259341dc4340e43f99cd42fc32ebb1bd.png)

1. **Connectivity** : Public access: Yes  
 ![n9ZT1xx1Gfitgvxe1oZ89cRFAVMq9y87ZIM8vTf5pSMhbPdlNc6oZjs4g0wXf6smuEZE4Al9sxB05xbjjUAk8yn9PrHMvMSAXvVXP2-_XmyKbBtAquTIZmQHhKAWtm4O-FB5JESvAEVGupj3LGVfID4](https://us1.discourse-cdn.com/cdata/original/1X/5ef38dc872f62ddfe35ddd04c7b11f187dcfec65.png)
2. **Database Authentication** : Database and IAM database authentication  
 ![xZjFnyBGI5XBoko1IFHVFNPenx-KlNMek3BHE7eISCU6hbLytg9FBr4X_AO77ysneR2owqmdKXJSXePf0oP71dmhFSRmKdKbGzH7PSN5Xc2q7IVcOpEj43rPMMApkuaogE15N1ownB27p9CbUVgpmSc](https://us1.discourse-cdn.com/cdata/original/1X/dee02f2e7095593e7104795d5339aedafb9ecea6.png)
3. Create the database by configuring the above properties.  
 ![pHBw1yp5hJja7LK9qhN8-a9mtQaADynh-aYzv11nNKK5qrTqfd2HTL-vs2cCIOAbfaAHXtmWSu9k8oWJeXLBX7If3hVtUB-EvV5rciNF_JKDyuqPg3JoCkWVPK1huiW2LBVRl7holEw5setknXrTmzg](https://us1.discourse-cdn.com/cdata/original/1X/5ab6a3f6d54adbb60832bbcf8e8232ad90d2b965.png)

## Step 2: Creating the PostgreSQL user in pgAdmin&nbsp;

pgAdmin is a popular open-source and full-featured PostgreSQL administration tool. In this section, a new PostgreSQL user is created who will have the rights to perform certain database operations.

1. In PostgreSQL, right-click on ‘Servers’. Then, navigate to and click on Register \> Server.

2. Configure the RDS instance of PostgreSQL in the database console.

3. Create the PostgreSQL user by executing the following script:

4. Grant RDS access to the user with the command:

Note: Remember that db\_user represents the username you’ve created for PostgreSQL.

## Step 3: Creating an IAM role&nbsp;

IAM (Identity and Access Management) is a service offered by AWS that helps control access to AWS resources. An IAM role is an entity that defines a set of permissions for making AWS service requests. Here, an IAM role is created to manage permissions and control access to the PostgreSQL database.

1. Log in to the AWS portal, then search for IAM Roles and click on ‘Create Role’.

2. Configure the IAM Roles with the following settings:

3. Provide the role name and create the role

4. In the Permissions tab, click on ‘Add Permissions’ and create an Inline Policy

5. In ‘Specify permissions,’ pass the following JSON:

6. After creating the Inline Policy, please configure the Trust relationships.

## Step 4: Configuration of PostgreSQL in CData Sync and CData Drivers&nbsp;

CData Sync is a universal data pipeline that delivers automated continuous replication for a wide range of databases, CRMs, ERPs, and APIs. CData Drivers are universal data connectors that offer seamless integration with a wide range of data-driven applications and platforms. In this step, the PostgreSQL database is configured to work with CData Sync and CData Drivers. This ensures smooth data synchronization and seamless integration between your applications and the database.

1. Log in to the Sync Application, then navigate to the ‘Connections’ tab.
2. Click on ‘Add Connection’ and configure your PostgreSQL
3. Set the following connection properties:
  - **Connection Name** : Name the PostgreSQL connection

  - **Server** : Enter the endpoint of your RDS instance.

  - **AuthScheme** : AWSIAMRoles

  - **User** : Enter the same username you created in PostgreSQL (Section: Step 2)

  - **AWS Access Key** : Created for the IAM user.

  - **AWS Secret Key** : Enter the corresponding secret key for which you have created the access key.

  - **AWS Role ARN** : IAM Role ARN

  - **Database** : Enter the database name used in the RDS instance.

  - **Port** : Enter the port number from the RDS instance.

  - **UseSSL** : True

  - **SSLServerCert= \***

Each of these steps plays a crucial role in setting up a secure and efficient cloud-based PostgreSQL database using Amazon RDS, IAM Authentication, and CData Sync/CData PostgreSQL Driver. They collectively contribute to enhancing the security, manageability, and scalability of your database operations.

## Try CData Sync Today&nbsp;

To effortlessly integrate live and on-demand data with incredible speed and accuracy, sign up for a [30-day free trial](https://www.cdata.com/sync/download/) of CData Sync!
