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

[cloudwatch] SQS connected to SNS don't receive data when using KMS #11122

Closed
du291 opened this issue Oct 26, 2020 · 5 comments
Closed

[cloudwatch] SQS connected to SNS don't receive data when using KMS #11122

du291 opened this issue Oct 26, 2020 · 5 comments
Labels
@aws-cdk/aws-cloudwatch Related to Amazon CloudWatch bug This issue is a bug. effort/small Small work item – less than a day of effort good first issue Related to contributions. See CONTRIBUTING.md p1

Comments

@du291
Copy link

du291 commented Oct 26, 2020

When SQS is configured with QueueEncryption.KMS and master key is set, it does not successfully receive data from SNS that it is subscribed to.

Reproduction Steps

topic = aws_sns.Topic(self.stack, 'alarm-topic',
                              display_name='Topic for alarms',
                              topic_name=self.alarms_topic_name)
queue = aws_sqs.Queue(self.stack, 'alarm-queue',
                              encryption=aws_sqs.QueueEncryption.KMS,
                              encryption_master_key=key,
                              retention_period=core.Duration.days(7),
                              queue_name=self.alarms_queue_name
                              )
topic.add_subscription(aws_sns_subscriptions.SqsSubscription(queue))

What did you expect to happen?

Successfully retrieve message from SQS

What actually happened?

When the SNS has delivery logs enabled, the following failure appears in the log:

{
"notification": {
"messageMD5Sum": "2bc17714a33dbaf9dbe6a57a8410eb7f",
"messageId": "054099fb-9d8e-5f40-b657-c1eb69e60b29",
"topicArn": "[SNS ARN]",
"timestamp": "2020-10-26 15:58:32.47"
},
"delivery": {
"deliveryId": "c894a538-64e0-5577-b85d-fd2890888698",
"destination": "[SQS ARN],
"providerResponse": "{"ErrorCode":"KMS.AccessDeniedException","ErrorMessage":"null (Service: AWSKMS; Status Code: 400; Error Code: AccessDeniedException; Request ID: 9582607-3c84-4f8e-8d4b-fa9932c21146; Proxy: null)","sqsRequestId":"Unrecoverable"}",
"dwellTimeMs": 66,
"attempts": 1,
"statusCode": 400
},
"status": "FAILURE"
}

Environment

CLI Version : 1.70
Framework Version: Python 3.8.5
Node.js Version: v14.11.0
OS : Linux
Language (Version): Python (3.8.5)

Other


This is 🐛 Bug Report

@du291 du291 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 26, 2020
@SomayaB SomayaB changed the title [aws_cloudwatch] SQS connected to SNS don't receive data when using KMS [cloudwatch] SQS connected to SNS don't receive data when using KMS Oct 26, 2020
@github-actions github-actions bot added the @aws-cdk/aws-cloudwatch Related to Amazon CloudWatch label Oct 26, 2020
@rix0rrr
Copy link
Contributor

rix0rrr commented Nov 2, 2020

I would think that the key needs a permission added to have the SNS service principal be able to encrypt using it.

@rix0rrr rix0rrr added effort/small Small work item – less than a day of effort good first issue Related to contributions. See CONTRIBUTING.md p1 labels Nov 2, 2020
@SomayaB SomayaB removed the needs-triage This issue or PR still needs to be triaged. label Nov 2, 2020
@rrhodes
Copy link
Contributor

rrhodes commented Jun 14, 2021

I may be mistaken, but this sounds like a duplicate of #2504.

@sekhavati
Copy link

sekhavati commented Oct 2, 2021

Experiencing the same issue when using QueueEncryption.KMS_MANAGED on SQS

@HansFalkenberg-Visma
Copy link

I agree with rrhodes, this was fixed by #2504 released in https://github.com/aws/aws-cdk/releases/tag/v1.111.0 (July 2nd 2021).

I am guessing sekhavati either used an old version, or did not specify encryptionMasterKey. You must use a custom CMK, not an AWS key, as will be verified if #19796 is implemented.

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-cloudwatch Related to Amazon CloudWatch bug This issue is a bug. effort/small Small work item – less than a day of effort good first issue Related to contributions. See CONTRIBUTING.md p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants