Skip to content

Data Source: awsCloudfrontLogDeliveryCanonicalUserId

The CloudFront Log Delivery Canonical User ID data source allows access to the canonical user ID of the AWS awslogsdelivery account for CloudFront bucket logging. See the Amazon CloudFront Developer Guide for more information.

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 awsS3BucketExample = new aws.s3Bucket.S3Bucket(this, "example", {
  bucket: "example",
});
const dataAwsCloudfrontLogDeliveryCanonicalUserIdExample =
  new aws.dataAwsCloudfrontLogDeliveryCanonicalUserId.DataAwsCloudfrontLogDeliveryCanonicalUserId(
    this,
    "example_1",
    {}
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
dataAwsCloudfrontLogDeliveryCanonicalUserIdExample.overrideLogicalId("example");
const awsS3BucketAclExample = new aws.s3BucketAcl.S3BucketAcl(
  this,
  "example_2",
  {
    accessControlPolicy: {
      grant: [
        {
          grantee: {
            id: dataAwsCloudfrontLogDeliveryCanonicalUserIdExample.id,
            type: "CanonicalUser",
          },
          permission: "FULL_CONTROL",
        },
      ],
    },
    bucket: awsS3BucketExample.id,
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsS3BucketAclExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • region - (Optional) Region you'd like the zone for. By default, fetches the current region.

Attributes Reference

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

  • id - Canonical user ID for the AWS awslogsdelivery account in the region.