Connect to Amazon RDS using IAM database authentication

Last modified: May 9, 2024

IAM (Identity and Access Management) is a web service for safely controlling AWS resources. With it, you can manage users and credentials, administer permissions, and access policies.

In this guide, we will walk you through connecting to Amazon RDS using dbForge Studio for MySQL. It is assumed that you already have an IAM database with configured IAM DB authentication. If you have not set this up yet, please refer to What Is AWS IAM? How to Connect to Amazon RDS Using IAM Database Authentication for detailed instructions.

Prerequisites

Before starting, you should have the following tools installed:

Generate an IAM authentication token

1. First of all, it’s required to configure the CLI. For this, open it and run this command to set up your AWS credentials (access key ID and secret access key), default region, and output format.

Note

To obtain an access key ID and secret access key, navigate to the user’s details page within the IAM dashboard. Then, in the Summary section, click Create access key to generate the credentials.

aws configure

3. To generate the authentication token, run the following command, adjusting the values within the brackets to match your specific settings:

aws rds generate-db-auth-token --hostname <db-instance-endpoint> --port <db-port> --region <aws-region> --username <db-username>

Generate the token

4. With the generated token, you can connect to an RDS instance. In dbForge Studio for MySQL, click New Connection.

New Connection

5. In the Database Connection Properties dialog that opens, go to the Security tab and enable SSL security protocol.

Use security protocol

6. On the General tab of the Database Connection Properties dialog, enter the host name, the user name, and the token you have generated in Step 1.

7. If you want to ensure that your settings are correct, click Test Connection. Click Connect.

Connect Amazon RDS