-
Notifications
You must be signed in to change notification settings - Fork 428
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: create dedicated kms for Aurora addon #2207
Conversation
templates/addons/aurora/cf.yml
Outdated
Principal: | ||
AWS: !Sub 'arn:aws:iam::${AWS::AccountId}:root' | ||
Action: 'kms:*' | ||
Resource: '*' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we limit these resources to just the Aurora DB?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This statement is to prevent the key from being unmanageable in the future (doc). KMS guards against this sort of unmanageable situation and the resource will fail to create.
templates/addons/aurora/cf.yml
Outdated
@@ -31,6 +31,34 @@ Mappings: | |||
{{end -}} | |||
{{end}} | |||
Resources: | |||
{{logicalIDSafe .ClusterName}}AuroraKMSCMK: | |||
Type: 'AWS::KMS::Key' | |||
DeletionPolicy: Retain |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove this deletion policy? 🙏
templates/addons/aurora/cf.yml
Outdated
Resource: '*' | ||
Condition: | ||
StringEquals: | ||
'kms:CallerAccount': !Ref 'AWS::AccountId' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice conditionals!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…s always encrpyted and default kms is used
Previously the Aurora addons use the default KMS key for app by importing the exported KMS resource. However, it's not able to`ImportValue` if the service uses a different account. This PR fixes this issue by creating a dedicated KMS resource for each Aurora addon. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Previously the Aurora addons use the default KMS key for app by importing the exported KMS resource. However, it's not able to
ImportValue
if the service uses a different account. This PR fixes this issue by creating a dedicated KMS resource for each Aurora addon.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.