-
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
(aws-kms): circular dependency when encrypted bucket notifications are setup with encrypted SQS queue #17786
Comments
For folks googling, this is still broken in V2.22. Also this does not effect only SQS but also S3 buckets in a similar way. |
This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
this is an unbelievable issue.
such simple procedure cant be done due to circular dependency... an unused feature |
Is creating an alias for |
Per @kornicameister suggestion, the below worked for me. The trick was to give the KMS Key Alias as a SAM Parameter and reference that value throughout:
|
What is the problem?
A circular dependency error is thrown during
cdk deploy
when using a KMS key for encrypting an S3 bucket and an SQS queue, then setup a notification on the S3 bucket to message the SQS queue.Reproduction Steps
See full repro code
What did you expect to happen?
No circular dependency error.
What actually happened?
On
cdk deploy
:CDK CLI Version
2.0.0-rc.33 (build 336ff5e)
Framework Version
No response
Node.js Version
v16.13.0
OS
macOS Montery 12.0.1 (21A559)
Language
Python
Language Version
v3.9.8
Other information
This bug was discovered from a StackOverflow question
Related GitHub issue: #11158
It looks like the root problem is that the following condition is added to the KMS key:
KMS key resource Properties.KeyPolicy.Statement[1]:
The S3 bucket depends on the KMS key for encryption, and the KMS key has a condition that depends on the S3 bucket.
Workaround
I was able to deploy the stack after using escape hatches to delete the condition:
workaround code available here
The text was updated successfully, but these errors were encountered: