Skip to content

Data Source: awsCanonicalUserId

The Canonical User ID data source allows access to the canonical user ID for the effective account in which Terraform is working.

\~> NOTE: To use this data source, you must have the s3:listAllMyBuckets permission.

Example Usage

import * as cdktf from "cdktf";
/*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 dataAwsCanonicalUserIdCurrent =
  new aws.dataAwsCanonicalUserId.DataAwsCanonicalUserId(this, "current", {});
new cdktf.TerraformOutput(this, "canonical_user_id", {
  value: dataAwsCanonicalUserIdCurrent.id,
});

Argument Reference

There are no arguments available for this data source.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • id - Canonical user ID associated with the AWS account.

  • displayName - Human-friendly name linked to the canonical user ID. The bucket owner's display name. NOTE: This value is only included in the response in the US East (N. Virginia), US West (N. California), US West (Oregon), Asia Pacific (Singapore), Asia Pacific (Sydney), Asia Pacific (Tokyo), EU (Ireland), and South America (São Paulo) regions.