From 154560c73e2ae4cf547ae39e48c1f0fe474d5e79 Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Mon, 17 Sep 2018 15:28:54 +0200 Subject: [PATCH] fix(aws-s3): remove `policy` argument This argument served as a red herring, and made it harder for people to find the correct method of setting a bucket policy, by calling `addToPolicy()`. The provided method of providing an existing Policy object on object creation cannot actually work, because a `BucketPolicy` object requires the `Bucket` instance as a constructor argument, which means the `Bucket` object cannot take a `BucketPolicy` in its constructor. Fixes #672. --- packages/@aws-cdk/aws-s3/lib/bucket.ts | 9 --------- 1 file changed, 9 deletions(-) diff --git a/packages/@aws-cdk/aws-s3/lib/bucket.ts b/packages/@aws-cdk/aws-s3/lib/bucket.ts index 48bb6651ff19a..5fc90c289dd24 100644 --- a/packages/@aws-cdk/aws-s3/lib/bucket.ts +++ b/packages/@aws-cdk/aws-s3/lib/bucket.ts @@ -323,14 +323,6 @@ export interface BucketProps { */ removalPolicy?: cdk.RemovalPolicy; - /** - * The bucket policy associated with this bucket. - * - * @default A bucket policy will be created automatically in the first call - * to addToPolicy. - */ - policy?: BucketPolicy; - /** * Whether this bucket should have versioning turned on or not. * @@ -379,7 +371,6 @@ export class Bucket extends BucketRef { cdk.applyRemovalPolicy(resource, props.removalPolicy); this.versioned = props.versioned; - this.policy = props.policy; this.encryptionKey = encryptionKey; this.bucketArn = resource.bucketArn; this.bucketName = resource.ref;