-
Notifications
You must be signed in to change notification settings - Fork 4k
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
elbv2: cannot use load balancer access logs when bucket is encrypted with KMS key #21947
Comments
I wasn't able to reproduce this with the snippet you've provided, have you made sure to specify the |
Hey @peterwoodworth sorry about that, I've taken some time to strip away the components of our app irrelevant to the reproduction and have created this repo https://github.com/josefaidt/cdk-accesslogs-repro |
ApplicationLoadBalancedFargateService
I was able to reproduce this with your repo, thanks! Based on your setup, I was suspicious of the bucket configurations you had, so i removed them and deployed a bucket with all props set to default. This worked - so this lead me to find that the cause of this issue is with your bucket settings:
I believe having your bucket be encrypted with a KMS key prevents you from using access logs here unfortunately. We could add a check for this in the aws-cdk/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/base-load-balancer.ts Line 248 in 6ad48a3
|
Hey folks, I accidentally ran into this issue while trying to trace down something else. I have raised a PR for this here |
Hey @peterwoodworth great callout, and the fix was very straightforward. By modifying the following bucket props I was able to enable access logs for my load balancer 🙂 - bucketKeyEnabled: true,
- encryption: s3.BucketEncryption.KMS,
+ encryption: s3.BucketEncryption.S3_MANAGED, |
|
Describe the bug
I am running into almost exactly what is described in this previous issue and similar to this StackOverflow post where I have:
And am receiving
Am I missing an additional piece of configuration for the bucket to enable access logs?
Expected Behavior
Access logs are enabled and emitted to bucket
Current Behavior
Running
cdk deploy
with the snippet shown in the section above we are presented with what appears to be the correct permissionsAnd we are receiving the following as CDK starts to deploy the changes
Reproduction Steps
https://github.com/josefaidt/cdk-accesslogs-repro
Our repository and code can be found here https://github.com/aws-amplify/discord-bot/blob/main/cdk/src/components/hey-amplify-app.ts#L250
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.39.1 (build f188fac)
Framework Version
2.39.1
Node.js Version
v18.7.0
OS
macos
Language
Typescript
Language Version
4.8.2
Other information
No response
The text was updated successfully, but these errors were encountered: