| title | Connecting to AWS's Relational Database Service (RDS) | |
|---|---|---|
| redirect_from |
|
RDS offers several databases that Metabase officially supports, including PostgreSQL, MySQL, MariaDB, Oracle, and SQL server.
Here's how to get connection information for databases on Amazon's RDS:
- Go to your AWS Management Console.
- Need help finding that? Visit
https://**My_AWS_Account_ID**.signin.aws.amazon.com/console. Be sure to insert your own AWS Account ID, though!
- Need help finding that? Visit
- Go to Database > RDS > Instances.
- Select the database you want to connect to Metabase.
- Get the information you'll need to connect Metabase to your RDS:
- Hostname. This is listed as the Endpoint parameter.
- Port. Find the port parameter under Security and Network.
- Username. Find this under Configuration Details.
- Database Name. Find this under Configuration Details.
- Password. Ask your database administrator for the password.
{% include plans-blockquote.html feature="IAM authentication" self-hosted-only="true" %}
You can connect to RDS PostgreSQL and MySQL instances and Aurora PostgreSQL/MySQL using AWS IAM authentication instead of a password.
To set up IAM authentication:
- In AWS, enable IAM authentication on your RDS instance
- In AWS, set up an IAM policy
- In your database, create a database user
- In your Metabase environment, configure AWS credentials
- In Metabase, select IAM authentication
- In Metabase, configure SSL
Enable IAM authentication on your RDS instance in the AWS console.
Add a policy with the rds-db:connect action. The policy resource must specify the Amazon Resource Name (ARN) of your database user in the format:
arn:aws:rds-db:region:account-id:dbuser:DbiResourceId/db-user-name
When entering the username in Metabase, you'd just enter your db-user-name, not the full ARN.
See Creating IAM policy for IAM database access.
Create the database user with IAM authentication enabled. The database username must match exactly (case-sensitive) with the db-user-name portion of your IAM policy Amazon Resource Name (ARN).
PostgreSQL:
CREATE USER your_username;
GRANT rds_iam TO your_username;MySQL:
CREATE USER 'your_username'@'%' IDENTIFIED WITH AWSAuthenticationPlugin AS 'RDS';See Setting up for IAM database authentication.
Authentication credentials must be available via one of the methods supported by the AWS SDK credentials chain, typically either:
- Environment variables (
AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEY) - AWS credentials file (
.aws/credentials), automatically available if running in Elastic Container Service (ECS)
When adding or editing a database connection in Metabase, click Use an authentication provider and select IAM Authentication.
Use a secure connection (SSL):
- PostgreSQL: Set the SSL Mode to require. See PostgreSQL SSL options.
- MySQL: The SSL Mode will be automatically set to verify-ca. If you manually change the SSL Mode, it must be set to verify-ca. See MySQL SSL options.