Aws_cloudfront: Issue when enabling logging for cloudfront distribution #33297
Labels
@aws-cdk/aws-cloudfront
Related to Amazon CloudFront
bug
This issue is a bug.
p2
response-requested
Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Describe the bug
I’m trying to enable CloudFront distribution logging with an S3 bucket, but I’m encountering an issue with the logging bucket. According to the documentation https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront-readme.html#logging It's possible to create a bucket logs with the props
enableLogging
However, I’m getting the following error:
"Access denied for operation 'You don't have permission to access the S3 bucket for CloudFront logs: ...-78ioohdal29u.s3.eu-central-2.amazonaws.com If you're using IAM, you need s3:GetBucketAcl and s3:PutBucketAcl permissions to create a distribution or to update log settings for an existing distribution. In addition, the S3 ACL for the bucket must grant you FULL_CONTROL."
I also tried specifying the bucket for logging, but I received the same error :
It seems that the issue is related to missing permissions for the S3 bucket.
Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
The logs should be stored in the S3 bucket.
Current Behavior
When attempting to enable logging for the CloudFront distribution the following error occurred
"Access denied for operation 'You don't have permission to access the S3 bucket for CloudFront logs: ...-78ioohdal29u.s3.eu-central-2.amazonaws.com If you're using IAM, you need s3:GetBucketAcl and s3:PutBucketAcl permissions to create a distribution or to update log settings for an existing distribution. In addition, the S3 ACL for the bucket must grant you FULL_CONTROL."
Reproduction Steps
cdk deploy
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.176.0
Framework Version
No response
Node.js Version
20.18.2
OS
Ubuntu
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: