Skip to content

Data Source: awsPartition

Use this data source to lookup information about the current AWS partition in which Terraform is working.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const dataAwsPartitionCurrent = new aws.dataAwsPartition.DataAwsPartition(
  this,
  "current",
  {}
);
new aws.dataAwsIamPolicyDocument.DataAwsIamPolicyDocument(this, "s3_policy", {
  statement: [
    {
      actions: ["s3:ListBucket"],
      resources: [
        `arn:\${${dataAwsPartitionCurrent.partition}}:s3:::my-bucket`,
      ],
      sid: "1",
    },
  ],
});

Argument Reference

There are no arguments available for this data source.

Attributes Reference

  • dnsSuffix - Base DNS domain name for the current partition (e.g., amazonawsCom in AWS Commercial, amazonawsComCn in AWS China).
  • id - Identifier of the current partition (e.g., aws in AWS Commercial, awsCn in AWS China).
  • partition - Identifier of the current partition (e.g., aws in AWS Commercial, awsCn in AWS China).
  • reverseDnsPrefix - Prefix of service names (e.g., comAmazonaws in AWS Commercial, cnComAmazonaws in AWS China).