Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(template.yaml): enable ACLs on cloudfront logging bucket and add bucket policy #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ivancasco
Copy link

Description of changes:
This Pull Request updates the configuration for the S3 bucket used to store CloudFront access logs. The changes ensure compatibility with AWS’s 2023 updates, where ACLs are disabled by default on new S3 buckets.

Without these updates, the stack no longer deploys, as it shows the following error:
Invalid request provided: AWS::CloudFront::Distribution:The S3 bucket that you specified for CloudFront logs does not enable ACL access:

Changes Introduced:

  • Enable ACLs:
    • Added ObjectOwnership: BucketOwnerPreferred to ensure all objects in the bucket are owned by the bucket owner, regardless of the uploader. This enables the ACLs on the bucket.
  • Access Control:
    • Added AccessControl: LogDeliveryWrite to allow CloudFront to write access logs to the bucket.
  • Bucket Policy:
    • Granted s3:PutObject permissions to the cloudfront.amazonaws.com service principal for log delivery.
    • Granted s3:GetBucketAcl and s3:PutBucketAcl permissions to cloudfront.amazonaws.com to manage ACLs as required.

Reference:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant