Connecting to your DB instance using IAM authentication (original) (raw)
With IAM database authentication, you use an authentication token when you connect to your DB instance. An authentication token is a string of characters that you use instead of a password. After you generate an authentication token, it's valid for 15 minutes before it expires. If you try to connect using an expired token, the connection request is denied.
Every authentication token must be accompanied by a valid signature, using AWS signature version 4. (For more information, see Signature Version 4 signing process in the AWS General Reference.) The AWS CLI and an AWS SDK, such as the AWS SDK for Java or AWS SDK for Python (Boto3), can automatically sign each token you create.
You can use an authentication token when you connect to Amazon RDS from another AWS service, such as AWS Lambda. By using a token, you can avoid placing a password in your code. Alternatively, you can use an AWS SDK to programmatically create and programmatically sign an authentication token.
After you have a signed IAM authentication token, you can connect to an Amazon RDS DB instance. Following, you can find out how to do this using either a command line tool or an AWS SDK, such as the AWS SDK for Java or AWS SDK for Python (Boto3).
For more information, see the following blog posts:
- Use IAM authentication to connect with SQL Workbench/J to Aurora MySQL or Amazon RDS for MySQL
- Using IAM authentication to connect with pgAdmin Amazon Aurora PostgreSQL or Amazon RDS for PostgreSQL
Prerequisites
The following are prerequisites for connecting to your DB instance using IAM authentication:
- Enabling and disabling IAM database authentication
- Creating and using an IAM policy for IAM database access
- Creating a database account using IAM authentication
Topics
- Connecting to your DB instance using IAM authentication with the AWS drivers
- Connecting to your DB instance using IAM authentication from the command line: AWS CLI and mysql client
- Connecting to your DB instance using IAM authentication from the command line: AWS CLI and psql client
- Connecting to your DB instance using IAM authentication and the AWS SDK for .NET
- Connecting to your DB instance using IAM authentication and the AWS SDK for Go
- Connecting to your DB instance using IAM authentication and the AWS SDK for Java
- Connecting to your DB instance using IAM authentication and the AWS SDK for Python (Boto3)
Creating a database account using IAM authentication
Connecting to your DB instance using IAM authentication with the AWS drivers
Did this page help you? - Yes
Thanks for letting us know we're doing a good job!
If you've got a moment, please tell us what we did right so we can do more of it.
Did this page help you? - No
Thanks for letting us know this page needs work. We're sorry we let you down.
If you've got a moment, please tell us how we can make the documentation better.