Skip to content

Commit

Permalink
fix: change public bucket access; (#11485)
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcvay authored Oct 21, 2024
1 parent 54449a5 commit 289a4cc
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/deployment-service/cdk/lib/create-S3-bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,20 @@ export enum BucketNames {

export const createBucket = (stack: Stack, bucketName: string, options?: BucketOptions): aws_s3.Bucket => {
const bucket = new aws_s3.Bucket(options?.stack || stack, bucketName, {
// publicReadAccess: false,
publicReadAccess: true,
websiteIndexDocument: options?.public ? 'index.html' : undefined,
bucketName: bucketName || PhysicalName.GENERATE_IF_NEEDED,
// blockPublicAccess: aws_s3.BlockPublicAccess.BLOCK_ALL,
accessControl: aws_s3.BucketAccessControl.PRIVATE,
objectOwnership: aws_s3.ObjectOwnership.BUCKET_OWNER_ENFORCED,
// accessControl: aws_s3.BucketAccessControl.PRIVATE,
// objectOwnership: aws_s3.ObjectOwnership.OBJECT_WRITER,
blockPublicAccess: new aws_s3.BlockPublicAccess({
blockPublicAcls: false,
ignorePublicAcls: false,
blockPublicPolicy: false,
restrictPublicBuckets: false,
}),
})

const actions: string[] = []
if (options?.get) {
actions.push('s3:Get*')
Expand Down

0 comments on commit 289a4cc

Please sign in to comment.