BucketProps has no objectOwnership, so there is no way to create an ACL-disabled bucket through the L2.
new aws.storage.Bucket(this, "History", {
bucketName: "example-tfmigrate",
objectOwnership: aws.storage.ObjectOwnership.BUCKET_OWNER_ENFORCED,
});
// error TS2353: Object literal may only specify known properties,
// and 'objectOwnership' does not exist in type 'BucketProps'.
// error TS2339: Property 'ObjectOwnership' does not exist on type
// 'typeof import(".../lib/aws/storage/index")'.
Current workaround
import { s3BucketOwnershipControls } from "@cdktn/provider-aws";
new s3BucketOwnershipControls.S3BucketOwnershipControls(this, "Ownership", {
bucket: bucket.bucketName,
rule: { objectOwnership: "BucketOwnerEnforced" },
});
Why it matters
BucketOwnerEnforced disables ACLs entirely and is what AWS recommends for new buckets — it has been the default for buckets created in the console since April 2023. A bucket whose access is governed purely by policies (as opposed to ACLs) is the common case, so needing the raw provider resource for it is a sharp edge.
aws-cdk models this as ObjectOwnership on BucketProps, which would be the natural shape here.
Observed on terraconstructs@0.2.12.
BucketPropshas noobjectOwnership, so there is no way to create an ACL-disabled bucket through the L2.Current workaround
Why it matters
BucketOwnerEnforceddisables ACLs entirely and is what AWS recommends for new buckets — it has been the default for buckets created in the console since April 2023. A bucket whose access is governed purely by policies (as opposed to ACLs) is the common case, so needing the raw provider resource for it is a sharp edge.aws-cdk models this as
ObjectOwnershiponBucketProps, which would be the natural shape here.Observed on
terraconstructs@0.2.12.