Created
October 22, 2019 11:07
-
-
Save mgjam/27b7459680ea47dbb255efd477ec1b4c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static createS3Bucket(scope: cdk.Construct, user: iam.User): s3.Bucket { | |
const name = 'bucket'; | |
const bucket = new s3.Bucket(scope, name, { | |
bucketName: name, | |
accessControl: s3.BucketAccessControl.PUBLIC_READ, | |
cors: [{ | |
allowedOrigins: [ '*' ], | |
allowedMethods: [ s3.HttpMethods.GET ], | |
allowedHeaders: [ '*' ] | |
}] | |
}); | |
bucket.grantWrite(user); | |
return bucket; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment