Grafana Cloud Enterprise
Last reviewed: July 23, 2026

Configure the Amazon Aurora data source

This document explains how to configure the Amazon Aurora data source and how to provision it with YAML or Terraform.

Before you begin

Before you configure the data source, ensure you have:

Example IAM permissions

The AWS user or role that Grafana uses to query Aurora must have the rds-db:connect permission for your cluster and database user. For example:

JSON
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": ["rds-db:connect"],
      "Resource": ["arn:aws:rds-db:us-east-2:1234567890:dbuser:cluster-ABCDEFGHIJKL01234/db_user"]
    }
  ]
}

For more information, refer to the AWS IAM database authentication policy documentation.

Key concepts

If you’re new to AWS or Aurora, these terms are used throughout the configuration:

TermDescription
IAM database authenticationAn AWS feature that lets you connect to your database using an IAM identity and a short-lived token instead of a database password.
RDS authentication tokenA temporary credential that the plugin generates with your AWS credentials and presents to the database as the password. Tokens expire after 15 minutes.
Assume roleAn AWS mechanism that lets one identity take on temporary credentials for another role, often used for cross-account access.
Reader endpointAn Aurora cluster endpoint that load-balances connections across all read replicas. Grafana recommends the reader endpoint for query workloads.
Private data source connect (PDC)A Grafana Cloud feature that routes data source traffic through a secure SOCKS proxy so Grafana can reach databases in private networks.

Add the data source

To add the Amazon Aurora data source:

  1. Click Connections in the left-side menu.
  2. Click Add new connection.
  3. Type Amazon Aurora in the search bar.
  4. Select Amazon Aurora.
  5. Click Add new data source.

Connection details

The plugin uses the AWS SDK for Go to obtain AWS credentials, then exchanges them for a temporary RDS authentication token that it uses as the database password. Configure how Grafana obtains AWS credentials in the Connection Details section.

Authentication

SettingDescription
Authentication ProviderWhich AWS credentials chain Grafana uses. Options include Access & secret key, Credentials file, and AWS SDK Default, which supports service-based IAM roles. Administrators can restrict the available providers with the allowed_auth_providers server setting. Refer to AWS authentication for details on each provider.
Access Key IDThe AWS access key ID, when using the Access & secret key provider. Stored encrypted.
Secret Access KeyThe AWS secret access key, when using the Access & secret key provider. Stored encrypted.
Credentials Profile NameThe profile to use from your AWS credentials file, when using the Credentials file provider.

Note

On Grafana Cloud, you must provide AWS access keys. Authenticating with only an IAM role, without access keys, isn’t currently supported for this data source. On self-managed Grafana, the AWS SDK Default provider can authenticate without keys through a service-based IAM role, such as an EC2 instance profile or an IAM role for service accounts.

Assume role

Optionally, configure the Assume Role section to have the selected authentication provider assume a role rather than use its credentials directly. The base credentials must have sts:AssumeRole permission for the target role.

SettingDescription
Assume Role ARNOptional. The Amazon Resource Name of the role to assume with the credentials from the selected provider.
External IDOptional. An external ID, sometimes required when assuming a role in another account.

Additional settings

SettingDescription
EndpointOptional. Overrides the default AWS service endpoint from the AWS SDK.
Default RegionThe AWS region of your Aurora cluster, such as us-west-2.

Database settings

Configure the connection to your Aurora cluster in the Database Settings section.

SettingDescription
EngineThe Aurora engine your cluster uses: Aurora (PostgreSQL Compatible) or Aurora (MySQL Compatible). Defaults to Aurora (PostgreSQL Compatible).
Database NameOptional. The name of the database to connect to.
Database UserRequired. The database user configured for IAM authentication.
Database HostRequired. The cluster endpoint to query. Grafana recommends the reader endpoint, which connects to your read replicas, because nothing in Grafana prevents writes to your database.
Database PortRequired. The port to connect to. Typically 5432 for PostgreSQL-compatible engines and 3306 for MySQL-compatible engines.

Separate host and port for authentication

To connect to your cluster, Grafana makes two calls:

  1. It generates an RDS authentication token for an endpoint.
  2. It opens an SQL connection to your database host using that token.

Usually both steps use the same endpoint. However, if your cluster is behind a load balancer, the RDS token must be generated for the actual cluster endpoint while SQL connections go through the load balancer. In that case, configure the Advanced: Separate Host and Port for Auth section:

SettingDescription
Advanced: DB Host For AuthOptional. The host to use when generating the RDS authentication token. If empty, Grafana uses Database Host.
Advanced: DB Port For AuthOptional. The port to use when generating the RDS authentication token. If empty, Grafana uses Database Port.

For example, set Database Host and Database Port to your load balancer endpoint, and set Advanced: DB Host For Auth and Advanced: DB Port For Auth to the cluster endpoint behind the load balancer.

Private data source connect

Private data source connect (PDC) lets Grafana Cloud reach Aurora clusters that aren’t exposed to the public internet. The plugin supports PDC for both PostgreSQL-compatible and MySQL-compatible engines and requires Grafana 10.0 or later.

Note

PDC is available only on Grafana Cloud. If you run self-managed Grafana, this section doesn’t apply. To reach private networks from a self-managed instance, use the secure SOCKS proxy instead.

To use PDC:

  1. Configure a PDC agent in your network. Refer to Private data source connect.
  2. In the data source settings, under Private data source connect, select your network in the Private data source connect network drop-down. The drop-down shows how many agents are connected for each network.
  3. To set up or manage networks, click Manage private data source connect networks.

Verify the connection

Click Save & test to verify the connection. When the connection test passes, Grafana displays the message Data source is working.

Note

RDS authentication tokens expire after 15 minutes. If a token expires between queries, the plugin automatically generates a new token and retries the query once.

Query caching

To reduce the load on your Aurora cluster and speed up repeated queries, you can enable query caching for the data source. Query caching is available in Grafana Cloud and Grafana Enterprise, and is turned off by default for each data source.

To enable it, open the data source settings, go to the Cache tab, and click Enable. You can optionally set custom TTLs for cached queries. For details, refer to Query and resource caching.

Provision the data source

You can define the data source in YAML files as part of the Grafana provisioning system. For more information, refer to Provision Grafana.

The following provisioning properties are available:

PropertyDescription
jsonData.authTypeThe authentication provider: keys, credentials, or default.
jsonData.engineThe Aurora engine: aurora-postgres or aurora-mysql.
jsonData.defaultRegionThe AWS region of your cluster.
jsonData.dbNameOptional. The database name.
jsonData.dbUserThe database user configured for IAM authentication.
jsonData.dbHostThe cluster endpoint to query.
jsonData.dbPortThe port to connect to.
jsonData.dbHostAuthOptional. A separate host for generating the RDS authentication token.
jsonData.dbPortAuthOptional. A separate port for generating the RDS authentication token.
jsonData.assumeRoleArnOptional. The Amazon Resource Name of a role to assume.
jsonData.externalIdOptional. An external ID for assuming a role in another account.
jsonData.profileOptional. The credentials profile name, when authType is credentials.
jsonData.endpointOptional. Overrides the default AWS service endpoint.
jsonData.enableSecureSocksProxyOptional. Set to true to route traffic through private data source connect or the secure SOCKS proxy.
secureJsonData.accessKeyThe AWS access key ID, when authType is keys. Stored encrypted.
secureJsonData.secretKeyThe AWS secret access key, when authType is keys. Stored encrypted.
secureJsonData.sessionTokenOptional. An AWS session token, when using temporary credentials with authType: keys. Stored encrypted.

YAML provisioning examples

The following example provisions the data source with access and secret keys:

YAML
apiVersion: 1

datasources:
  - name: Amazon Aurora
    type: grafana-aurora-datasource
    editable: true
    jsonData:
      authType: keys
      engine: aurora-postgres
      defaultRegion: us-east-1
      dbName: testDatabase
      dbUser: db_user
      dbHost: example.cluster-ro-example.us-east-1.rds.amazonaws.com
      dbPort: 5432
    secureJsonData:
      accessKey: <AWS_ACCESS_KEY_ID>
      secretKey: <AWS_SECRET_ACCESS_KEY>
    version: 1

The following example uses the AWS SDK default credentials chain, which supports service-based IAM roles:

YAML
apiVersion: 1

datasources:
  - name: Amazon Aurora
    type: grafana-aurora-datasource
    editable: true
    jsonData:
      authType: default
      engine: aurora-mysql
      defaultRegion: us-east-1
      dbName: testDatabase
      dbUser: db_user
      dbHost: aurora-mysql.cluster-123.us-east-1.rds.amazonaws.com
      dbPort: 3306
    version: 1

The following example configures a cluster behind a load balancer, with a separate host and port for generating the authentication token:

YAML
apiVersion: 1

datasources:
  - name: Amazon Aurora behind a load balancer
    type: grafana-aurora-datasource
    editable: true
    jsonData:
      authType: keys
      engine: aurora-mysql
      defaultRegion: us-east-1
      dbName: testDatabase
      dbUser: db_user
      dbHost: protected-by-a-load-balancer.example.com
      dbPort: 3307
      dbHostAuth: aurora-mysql.cluster-123.us-east-1.rds.amazonaws.com
      dbPortAuth: 3306
    secureJsonData:
      accessKey: <AWS_ACCESS_KEY_ID>
      secretKey: <AWS_SECRET_ACCESS_KEY>
    version: 1

Provision with Terraform

You can also provision the data source with the Grafana Terraform provider using the grafana_data_source resource. The json_data_encoded and secure_json_data_encoded arguments accept the same keys as the YAML jsonData and secureJsonData properties.

hcl
terraform {
  required_providers {
    grafana = {
      source = "grafana/grafana"
    }
  }
}

resource "grafana_data_source" "aurora" {
  type = "grafana-aurora-datasource"
  name = "Amazon Aurora"

  json_data_encoded = jsonencode({
    authType      = "keys"
    engine        = "aurora-postgres"
    defaultRegion = "us-east-1"
    dbName        = "testDatabase"
    dbUser        = "db_user"
    dbHost        = "example.cluster-ro-example.us-east-1.rds.amazonaws.com"
    dbPort        = 5432
  })

  secure_json_data_encoded = jsonencode({
    accessKey = var.aws_access_key_id
    secretKey = var.aws_secret_access_key
  })
}

Store secrets such as AWS keys in Terraform variables or a secrets manager instead of hard-coding them in your configuration.

Next steps