Open joel-aws opened 11 months ago
Thanks @joel-aws for reporting this. I am able to reproduce this.
Me too. Wow only hit on the entire internet for this log message. Thanks very much for the suggestion to grant Service principal logs.amazonaws.com, but I agree, this was not intuitive at all.
It's missing kmsKey.grantEncryptDecrypt(new iam.ServicePrincipal(
logs.amazonaws.com))
after KMS key creation.
Describe the bug
From reading the docs, using a KMS CMK with a Log Group should involve just passing the key to the Log Group. However, when doing that alone, KMS lacks the required permission to interact with Logs.
Expected Behavior
For the
LogGroup
Construct to automatically set the required permissions to interact with KMS when a KMS CMK key is passed to it.Current Behavior
Reproduction Steps
Possible Solution
When passing a KMS CMK to a
LogGroup
, automatically grant the necessary permissions to thelogs.amazonaws.com
Service Principal.Additional Information/Context
No response
CDK CLI Version
2.114.1
Framework Version
No response
Node.js Version
18.16.0
OS
Mac
Language
Python
Language Version
No response
Other information
No response