Closed fredricbillow-axis closed 10 months ago
@fredricbillow-axis thanks for reporting this and sharing the link to the code as well. I am able to repro this.
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.
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
again Again, the diff shows IAM and resource changes.IAM Statement
Resources
Possible Solution
Most likely, the reason for the bug is located at https://github.com/aws/aws-cdk/blob/de7fb043c37569d39776623fe137860e279b9fbf/packages/%40aws-cdk/aws-appconfig-alpha/lib/extension.ts#L521
The statement
eventDestination.extensionUri
results in using theQueue.queueArn
value in the case of the event destination being an SqsDestination:https://github.com/aws/aws-cdk/blob/de7fb043c37569d39776623fe137860e279b9fbf/packages/%40aws-cdk/aws-appconfig-alpha/lib/extension.ts#L87
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