-
Notifications
You must be signed in to change notification settings - Fork 4.4k
grantPublicAccess() not granting access on an already existing bucket created manually #7370
Copy link
Copy link
Closed
Labels
@aws-cdk/aws-s3Related to Amazon S3Related to Amazon S3bugThis issue is a bug.This issue is a bug.documentationThis is a problem with documentation.This is a problem with documentation.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp1
Description
On https://docs.aws.amazon.com/cdk/api/latest/docs/aws-s3-readme.html#importing-existing-buckets there is an example which modifies access permissions on an already existing bucket, created manually from the AWS web console.
The example below does not modify the access permissions on the bucket, and the generated cdk.out/MyS3.template.json has an empty object.
Using https://github.com/aws/aws-cdk/releases/tag/v1.32.2 with typescript.
import cdk = require('@aws-cdk/core');
import s3 = require('@aws-cdk/aws-s3');
class MyS3 extends cdk.Stack {
constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {
super(scope, id, props);
const bucket = s3.Bucket.fromBucketName(this, 'bucket', 'my-bucket-random-string');
bucket.grantPublicAccess();
}
}
const app = new cdk.App();
new MyS3(app, 'MyS3');
app.synth();This is a 📕 documentation issue
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-s3Related to Amazon S3Related to Amazon S3bugThis issue is a bug.This issue is a bug.documentationThis is a problem with documentation.This is a problem with documentation.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp1