From c6384b7229b899802b14a8e04230c6aaaf4cc0de Mon Sep 17 00:00:00 2001 From: Anton Tayanovskyy Date: Thu, 3 Oct 2024 10:23:59 -0400 Subject: [PATCH] Do not configure ACL on the logs bucket Also clean up some comments. --- .../cms/infrastructure/index.ts | 26 +++++-------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/aws-ts-netlify-cms-and-oauth/cms/infrastructure/index.ts b/aws-ts-netlify-cms-and-oauth/cms/infrastructure/index.ts index acddfa658..ddc091c2a 100644 --- a/aws-ts-netlify-cms-and-oauth/cms/infrastructure/index.ts +++ b/aws-ts-netlify-cms-and-oauth/cms/infrastructure/index.ts @@ -22,19 +22,11 @@ const config = { }; // contentBucket is the S3 bucket that the website's contents will be stored in. -const contentBucket = new aws.s3.BucketV2("contentBucket", - { - bucket: config.targetDomain, - // acl: "public-read", - // // Configure S3 to serve bucket contents as a website. This way S3 will automatically convert - // // requests for "foo/" to "foo/index.html". - // website: { - // indexDocument: "index.html", - // // errorDocument: "404.html", - // }, - }); +const contentBucket = new aws.s3.BucketV2("contentBucket", { + bucket: config.targetDomain, +}); -const contentBucketWebsite = new aws.s3.BucketWebsiteConfigurationV2("contentBucket", { +const contentBucketWebsite = new aws.s3.BucketWebsiteConfigurationV2("contentBucket", { bucket: contentBucket.bucket, indexDocument: {suffix: "index.html"}, errorDocument: {key: "404.html"}, @@ -81,13 +73,9 @@ crawlDirectory( }); // logsBucket is an S3 bucket that will contain the CDN's request logs. -const logsBucket = new aws.s3.BucketV2("requestLogs", - { - bucket: `${config.targetDomain}-logs`, - acl: "private", - }); - -configureACL("requestLogs", logsBucket, "private"); +const logsBucket = new aws.s3.BucketV2("requestLogs", { + bucket: `${config.targetDomain}-logs`, +}); const tenMinutes = 60 * 10;