aws-appconfig-alpha: SQS Extension association always creates cdk diff #27676
Labels
@aws-cdk/aws-sqs
Related to Amazon Simple Queue Service
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
p2
Describe the bug
When using the
onDeploymentComplete
function on an Environment to create an Extension Association using SqsDestination, CDK will always show a diff. Deploying the stack does not resolve the issue and instead a new diff will be shown.Expected Behavior
When running
cdk diff
which shows a diff, then runningcdk deploy
to deploy the diff, there shouldn't be a new diff corresponding to the same resources. Runningcdk diff
again should show no diff.Current Behavior
You end up in an endless loop of diffs even when deploying every diff. The diff looks like:
IAM Statement
Resources
Reproduction Steps
Create a stack like so
Deploy the stack.
The stack should deploy without any issues.
Run
cdk diff
The diff shows both IAM statement changes and resource changes:
IAM Statement
Resources
Deploy the stack again.
The stack should deploy without any issues.
Run
cdk diff
againAgain, the diff shows IAM and resource changes.
IAM Statement
Resources
Possible Solution
Most likely, the reason for the bug is located at
aws-cdk/packages/@aws-cdk/aws-appconfig-alpha/lib/extension.ts
Line 521 in de7fb04
The statement
eventDestination.extensionUri
results in using theQueue.queueArn
value in the case of the event destination being an SqsDestination:aws-cdk/packages/@aws-cdk/aws-appconfig-alpha/lib/extension.ts
Line 87 in de7fb04
This results in a new ID being generated for the Role every time, ultimately replacing the current one as CDK treats it as a new Role.
A solution would be to use something else than the
queueArn
to create the ID of the Role.Additional Information/Context
No response
CDK CLI Version
2.102.0 (build 2abc59a)
Framework Version
2.102.0-alpha.0
Node.js Version
18.18.2
OS
macOS
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: