Grafana Cloud Enterprise Open source
Last reviewed: July 23, 2026

Configure the AWS IoT SiteWise data source

This document explains how to configure the AWS IoT SiteWise data source and provides links to related documentation.

Before you begin

Before you configure the data source, ensure you have:

  • Grafana permissions: The Organization administrator role. Only organization administrators can add data sources.
  • An AWS account with AWS IoT SiteWise enabled in at least one Region, or a configured SiteWise Edge gateway.
  • AWS credentials or an IAM identity with read access to AWS IoT SiteWise. At a minimum, grant iotsitewise:List*, iotsitewise:Describe*, and iotsitewise:Get*. To use the SQL query editor, also grant iotsitewise:ExecuteQuery.

Attach the following example policy to the IAM identity. Omit iotsitewise:ExecuteQuery if you don’t use the SQL query editor.

JSON
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "iotsitewise:List*",
        "iotsitewise:Describe*",
        "iotsitewise:Get*",
        "iotsitewise:ExecuteQuery"
      ],
      "Resource": "*"
    }
  ]
}

Key concepts

If you’re new to AWS, these terms are used throughout the configuration.

TermDescription
IAM policyA JSON document attached to an identity that grants AWS API permissions.
Assume roleAn AWS mechanism that lets one identity take on temporary credentials for another IAM role, often used for cross-account access.
External IDAn optional identifier that a role in another account requires when you assume it, which adds a layer of protection for cross-account access.
RegionThe AWS Region, such as us-east-1, where your AWS IoT SiteWise data is stored.
EndpointThe service URL that the data source connects to. Set a custom endpoint for private networks or SiteWise Edge.
AWS IoT SiteWise EdgeAn on-premises gateway that runs AWS IoT SiteWise locally on your own hardware.

Add the data source

To add the AWS IoT SiteWise data source:

  1. Click Connections in the left-side menu.
  2. Click Add new connection.
  3. Type AWS IoT SiteWise in the search bar.
  4. Select AWS IoT SiteWise from the search results.
  5. Click Add new data source.

Authentication

The AWS IoT SiteWise data source uses the same authentication system as the other AWS data sources in Grafana. In the data source settings, these options appear under Connection Details. Choose the method that matches your deployment.

MethodBest forGrafana CloudServer configuration required
AWS SDK DefaultSelf-managed Grafana with credentials in the environment or default chainNoYes
Workspace IAM RoleGrafana running on Amazon EC2 with an instance profileNoYes
Grafana Assume RoleGrafana Cloud users who want temporary credentialsYesNo
Access & secret keyAny deploymentYesNo
Credentials fileSelf-managed Grafana with an AWS credentials fileNoYes

Select the method from the Authentication Provider drop-down. The available options depend on the providers your Grafana administrator allows.

AWS SDK Default

This method uses the default AWS SDK credential chain, which resolves credentials from environment variables, shared configuration, or the container or instance role. Use it when Grafana runs on AWS infrastructure that already has AWS credentials available.

Workspace IAM Role

This method uses the IAM role attached to the Amazon EC2 instance that runs Grafana. Use it when Grafana runs on Amazon EC2 and you attach an instance profile with access to AWS IoT SiteWise.

Grafana Assume Role

This method lets Grafana assume an IAM role for temporary credentials without storing long-lived keys. It’s available in Grafana Cloud when your administrator enables it. Select Grafana Assume Role as the Authentication Provider, then expand How to create an IAM role for grafana to assume for the trust policy and steps. Create the role so it trusts the Grafana account, and enter its Amazon Resource Name in the Assume Role ARN field.

Access & secret key

This method uses a long-lived AWS access key ID and secret access key. Provide the following values.

SettingDescription
Access Key IDThe AWS access key ID for an IAM user with access to AWS IoT SiteWise.
Secret Access KeyThe AWS secret access key that pairs with the access key ID. Grafana stores this value as a secure setting.

Credentials file

This method reads credentials from an AWS shared credentials file on the Grafana server, typically at ~/.aws/credentials. Provide the profile name.

SettingDescription
Credentials Profile NameThe profile name in the shared credentials file. Leave blank to use the default profile.

Assume Role

The Assume Role section appears for every authentication provider. Grafana can assume an IAM role instead of using the selected provider’s credentials directly.

SettingDescription
Assume Role ARNOptional. The Amazon Resource Name of an IAM role to assume. Grafana uses the selected authentication provider to assume this role instead of using the credentials directly.
External IDOptional. The external ID required by a role in another account. This field doesn’t appear when you use Grafana Assume Role.

Additional settings

Set the following options in the Additional Settings section.

SettingDescription
EndpointOptional. A custom endpoint for the AWS IoT SiteWise service, in the form https://{service}.{region}.amazonaws.com. Required for SiteWise Edge. This field doesn’t appear when you use Grafana Assume Role.
Default RegionThe AWS Region that queries use by default, such as us-west-2 for US West (Oregon). Select Edge to connect to a SiteWise Edge gateway.

Connect to private networks

AWS IoT SiteWise is usually reachable over public AWS endpoints. If you need to reach a private endpoint, such as a SiteWise Edge gateway or a service behind a private network that isn’t publicly accessible, use one of the following options.

Private data source connect (Grafana Cloud)

If you use Grafana Cloud, use Private data source connect (PDC) to securely connect Grafana Cloud to a private network without opening the network to inbound traffic. PDC establishes an outbound connection from an agent that runs inside your network.

When PDC is enabled for your Grafana Cloud instance, a Private data source connect section appears in the data source settings, which lets you query data that lives within a secured network without opening the network to inbound traffic from Grafana Cloud. Select the Private data source connect network where your endpoint is available.

Note

Private data source connect is available exclusively in Grafana Cloud. On self-managed Grafana, use the secure Socks proxy, a VPN, or AWS PrivateLink to reach private endpoints.

For setup instructions, refer to Private data source connect.

Secure Socks proxy (self-managed Grafana)

On self-managed Grafana, if your administrator enables the secure Socks proxy, a Secure Socks Proxy section appears in the data source configuration so you can route requests through the proxy. This option requires Grafana version 10.0.0 or later. To enable it, configure the [secure_socks_datasource_proxy] section in the Grafana configuration file. For more information, refer to Configure Grafana.

Configure SiteWise Edge

SiteWise Edge lets you run AWS IoT SiteWise on an on-premises gateway. To connect to a gateway, select Edge as the Default Region. An explicit endpoint is required for Edge connections.

Select the Authentication Mode for the gateway.

ModeDescription
StandardUses the AWS authentication provider that you configured for the data source.
LinuxUses Linux-based authentication against the gateway’s local authentication proxy.
LDAPUses LDAP-based authentication against the gateway’s local authentication proxy.

Provide an SSL certificate for every Edge connection, including Standard mode.

SettingDescription
SSL CertificateThe PEM certificate used for SSL-enabled authentication. The value begins with -----BEGIN CERTIFICATE-----. Grafana stores this value as a secure setting.

To replace a saved certificate, click Reset and enter a new certificate.

For Linux and LDAP modes, also provide the following values.

SettingDescription
UsernameThe username sent to the local authentication proxy.
PasswordThe password sent to the local authentication proxy. Grafana stores this value as a secure setting.

Verify the connection

Click Save & test to verify the configuration. On success, Grafana returns OK. The data source runs a ListAssetModels request against AWS IoT SiteWise to confirm that the credentials and Region are valid.

If the test fails, refer to Troubleshooting.

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.

Access and secret key

YAML
apiVersion: 1

datasources:
  - name: AWS IoT SiteWise
    type: grafana-iot-sitewise-datasource
    jsonData:
      authType: keys
      defaultRegion: us-east-1
    secureJsonData:
      accessKey: <YOUR_ACCESS_KEY>
      secretKey: <YOUR_SECRET_KEY>

Credentials file

YAML
apiVersion: 1

datasources:
  - name: AWS IoT SiteWise
    type: grafana-iot-sitewise-datasource
    jsonData:
      authType: credentials
      defaultRegion: us-east-1
      profile: default

Assume role

YAML
apiVersion: 1

datasources:
  - name: AWS IoT SiteWise
    type: grafana-iot-sitewise-datasource
    jsonData:
      authType: keys
      defaultRegion: us-east-1
      assumeRoleArn: arn:aws:iam::123456789012:role/grafana-sitewise
      externalId: <YOUR_EXTERNAL_ID>
    secureJsonData:
      accessKey: <YOUR_ACCESS_KEY>
      secretKey: <YOUR_SECRET_KEY>

Edge gateway

YAML
apiVersion: 1

datasources:
  - name: AWS IoT SiteWise Edge
    type: grafana-iot-sitewise-datasource
    jsonData:
      defaultRegion: Edge
      endpoint: https://<YOUR_EDGE_GATEWAY_HOST>
      edgeAuthMode: linux
      edgeAuthUser: <YOUR_EDGE_USERNAME>
    secureJsonData:
      edgeAuthPass: <YOUR_EDGE_PASSWORD>
      cert: |
        -----BEGIN CERTIFICATE-----
        <YOUR_CERTIFICATE>
        -----END CERTIFICATE-----

The following table describes the provisioning keys.

KeyDescription
authTypeThe authentication method: keys, credentials, default, ec2_iam_role, or grafana_assume_role.
defaultRegionThe default AWS Region. Set to Edge for a SiteWise Edge gateway.
profileThe credentials file profile name.
assumeRoleArnThe Amazon Resource Name of an IAM role to assume.
externalIdThe external ID for cross-account role assumption.
endpointA custom service endpoint. Required for Edge.
edgeAuthModeThe Edge authentication mode: default, linux, or ldap.
edgeAuthUserThe Edge local proxy username.
accessKeyThe AWS access key ID. Store in secureJsonData.
secretKeyThe AWS secret access key. Store in secureJsonData.
sessionTokenAn optional session token for temporary credentials. Store in secureJsonData.
edgeAuthPassThe Edge local proxy password. Store in secureJsonData.
certThe PEM SSL certificate for Edge. Required for every Edge authentication mode, including Standard. Store in secureJsonData.
enableSecureSocksProxySet to true to route requests through the secure Socks proxy on self-managed Grafana.

Secure Socks proxy

To route a provisioned data source through the secure Socks proxy, set enableSecureSocksProxy to true.

YAML
apiVersion: 1

datasources:
  - name: AWS IoT SiteWise
    type: grafana-iot-sitewise-datasource
    jsonData:
      authType: keys
      defaultRegion: us-east-1
      enableSecureSocksProxy: true
    secureJsonData:
      accessKey: <YOUR_ACCESS_KEY>
      secretKey: <YOUR_SECRET_KEY>

Provision with Terraform

You can use the Grafana Terraform provider to provision the AWS IoT SiteWise data source as code. The following examples use the grafana_data_source resource.

Access and secret key with Terraform

hcl
resource "grafana_data_source" "sitewise" {
  type = "grafana-iot-sitewise-datasource"
  name = "AWS IoT SiteWise"

  json_data_encoded = jsonencode({
    authType      = "keys"
    defaultRegion = "us-east-1"
  })

  secure_json_data_encoded = jsonencode({
    accessKey = var.aws_access_key
    secretKey = var.aws_secret_key
  })
}

To use temporary AWS credentials from STS, add sessionToken to secure_json_data_encoded:

hcl
  secure_json_data_encoded = jsonencode({
    accessKey    = var.aws_access_key
    secretKey    = var.aws_secret_key
    sessionToken = var.aws_session_token
  })

Assume role with Terraform

hcl
resource "grafana_data_source" "sitewise" {
  type = "grafana-iot-sitewise-datasource"
  name = "AWS IoT SiteWise"

  json_data_encoded = jsonencode({
    authType      = "default"
    defaultRegion = "us-east-1"
    assumeRoleArn = "arn:aws:iam::123456789012:role/grafana-sitewise"
    externalId    = var.external_id
  })
}

For more information, refer to the grafana_data_source resource in the Grafana Terraform provider documentation.

Next steps