Skip to content
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(sqs) KMS-Managed SQS encryption generate valid IAM Policy for gra… #3133

Closed
wants to merge 3 commits into from

Conversation

ScOut3R
Copy link
Contributor

@ScOut3R ScOut3R commented Jun 29, 2019

fix(sqs) KMS-Managed SQS encryption generate valid IAM Policy for grantee (#2794)

fixes #2794

Please let me know if this is not the right way to resolve the issue.

@ScOut3R ScOut3R requested a review from a team as a code owner June 29, 2019 17:18
@ghost ghost requested a review from shivlaks June 29, 2019 17:18
@RomainMuller
Copy link
Contributor

I have written an alternate version in #3169, which I reckon is slightly superior (as I noted, there is literally no need for the statement to be emitted in the first place).

Nevertheless, thank you for both reporting the issue, and spending the time to attempt a fix (which is good, the above consideration aside!).

@@ -277,7 +277,7 @@ export class Queue extends QueueBase {
}

if (encryption === QueueEncryption.KMS_MANAGED) {
const masterKey = kms.Key.fromKeyArn(this, 'Key', 'alias/aws/sqs');
const masterKey = kms.Key.fromKeyArn(this, 'Key', `arn:aws:kms:${Aws.REGION}:${Aws.ACCOUNT_ID}:alias/aws/sqs`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This grant isn't even necessary. The AWS-managed key will allow appropriate usage anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense and I've should have noticed this we are dealing with the default key here. :D

Thank you for fixing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KMS-Managed SQS encyption generating invalid IAM policy for Lambda func
2 participants