Data Source: awsS3BucketPolicy
The bucket policy data source returns IAM policy of an S3 bucket.
Example Usage
The following example retrieves IAM policy of a specified S3 bucket.
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 dataAwsS3BucketPolicyExample =
new aws.dataAwsS3BucketPolicy.DataAwsS3BucketPolicy(this, "example", {
bucket: "example-bucket-name",
});
new cdktf.TerraformOutput(this, "foo", {
value: dataAwsS3BucketPolicyExample.policy,
});
Argument Reference
The following arguments are supported:
bucket
- (Required) Bucket name.
Attributes Reference
In addition to all arguments above, the following attributes are exported:
policy
- IAM bucket policy.