awslabs / aws-solutions-constructs

The AWS Solutions Constructs Library is an open-source extension of the AWS Cloud Development Kit (AWS CDK) that provides multi-service, well-architected patterns for quickly defining solutions
https://docs.aws.amazon.com/solutions/latest/constructs/
Apache License 2.0
1.19k stars 240 forks source link

SnsToSqs minimal deployable pattern barfs loud red warnings #1119

Closed revanshine closed 1 month ago

revanshine commented 1 month ago

The minimal deployable pattern for SnsToSqs barfs loud red warnings making it difficult to understand and adopt.

Reproduction Steps

Create a CDK project and add the code from the minimal deployable pattern definition here: https://constructs.dev/packages/@aws-solutions-constructs/aws-sns-sqs/v/2.57.0?lang=typescript

Error Log

WARN AWS_SOLUTIONS_CONSTRUCTS_WARNING: Ignoring enableEncryptionWithCustomerManagedKey because one of topicProps.masterKey, encryptionKey, or encryptionKeyProps was already specified WARN AWS_SOLUTIONS_CONSTRUCTS_WARNING: Ignoring enableEncryptionWithCustomerManagedKey because one of WARN AWS_SOLUTIONS_CONSTRUCTS_WARNING: queueProps.encryptionMasterKey, encryptionKey, or encryptionKeyProps was already specified [Warning at /MyStack/SnsToSqsPattern/queue] encryption: Automatically changed to QueueEncryption.KMS, was: QueueEncryption.KMS_MANAGED When encryptionMasterKey is provided, always set encryption: QueueEncryption.KMS [ack: @aws-cdk/aws-sqs:queueEncryptionChangedToKMS]

Environment

Other


This is :bug: Bug Report

revanshine commented 1 month ago

Also, the minimal deployable pattern won't deploy:

Circular dependency between resources: [SnsToSqsPatternqueueFBC4436B, SnsToSqsPatternqueueMyStackSnsToSqsPatternSnsTopic372915C855A347C7, SnsToSqsPatternSnsTopic4E90E51B, SnsToSqsPatternKeyE8ABAEAE, SnsToSqsPatternqueuePolicy56BD807B, SnsToSqsPatternSnsTopicPolicyA2F69F7F]

Please fix.

biffgaut commented 1 month ago

Thanks, we'll check it out.

biffgaut commented 1 month ago

We're still looking into this, but we have found that the circular reference was introduced with a feature change in CDK v2.32.0 and is controlled by a feature flag. For the moment, you can turn off this change by setting the feature flag to false in cdk.json:

    "@aws-cdk/aws-sns-subscriptions:restrictSqsDescryption": false,

That will allow you to move forward while we continue to examine the issue.