Provision CloudWatch data source

You can configure the CloudWatch data source by customizing configuration files in Grafana’s provisioning system. To know more about provisioning and learn about available configuration options, refer to the Provisioning Grafana topic.

Here are some provisioning examples for this data source.

Using AWS SDK (default)

  1. apiVersion: 1
  2. datasources:
  3. - name: CloudWatch
  4. type: cloudwatch
  5. jsonData:
  6. authType: default
  7. defaultRegion: eu-west-2

Using credentials’ profile name (non-default)

  1. apiVersion: 1
  2. datasources:
  3. - name: CloudWatch
  4. type: cloudwatch
  5. jsonData:
  6. authType: credentials
  7. defaultRegion: eu-west-2
  8. customMetricsNamespaces: 'CWAgent,CustomNameSpace'
  9. profile: secondary

Using accessKey and secretKey

  1. apiVersion: 1
  2. datasources:
  3. - name: CloudWatch
  4. type: cloudwatch
  5. jsonData:
  6. authType: keys
  7. defaultRegion: eu-west-2
  8. secureJsonData:
  9. accessKey: '<your access key>'
  10. secretKey: '<your secret key>'

Using AWS SDK Default and ARN of IAM Role to Assume

  1. apiVersion: 1
  2. datasources:
  3. - name: CloudWatch
  4. type: cloudwatch
  5. jsonData:
  6. authType: default
  7. assumeRoleArn: arn:aws:iam::123456789012:root
  8. defaultRegion: eu-west-2