-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
core: cdk deploy wiping stack notification ARNs property #32153
Comments
Hi Looks like the PR you mentioned essentially added a new Did you mean you actually had |
trying to create a minimal sample to verify it now. |
If I read this correctly, the scenario is:
Or in other words, with v2.159.1 and before you could "tell" the CDK to just not care about Notification ARNs at all. If this is confirmed, the code bug is probably the difference between not setting a parameter (old) and passing an empty array to the parameter (new). |
HI @wilhen01 I am assuming your code export class MyStack extends cdk.Stack {
constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {
super(scope, id, props);
// Cfnout notificationArns
new cdk.CfnOutput(this, 'NotificationARNs', {
value: cdk.Fn.select(0, this.notificationArns),
});
}
} in 2.159.1 you probably deploy like this
And you see this
Now, when you upgrade to 2.160.0 without changing any code. From my test if you continue deploy with that, you should still see that output. The behavior won't change. Can you tell us how did you deploy that with the notificationArn in 2.159.1? From what I can see the |
@mrgrain's summary is accurate @pahud - the stacks we're experiencing this problem with don't specify noticationArns at all. Basically the flow is:
prior to 2.160.0, the notification ARNs added by the internal tooling platform would be maintained across subsequent stack updates via |
Sounds like this is beyond CDK? Is the internal tooling executing the AWS SDK call to update the stack with a notificationArn and also pull that ARN via SDK calls as well? If that's the case, what's happening in 2.160.0 is that if the props.notificationArn is undefined, it would be explicit set to
I am not sure if it's necessary to set it to
I will bring this up to the team for further inputs. |
Comments on closed issues and PRs are hard for our team to see. |
1 similar comment
Comments on closed issues and PRs are hard for our team to see. |
…deploy` (#32163) Closes #32153. ### Reason for this change When a stack contains externally managed notification ARNs (i.e ones that were added outside of CDK), a `cdk deploy` command will remove those ARNs. ### Description of changes We incorrectly default notification ARNs to `[]` instead of `undefined`. When an empty array is passed to the SDK , it reasonably assumes you want to delete existing ARNs (because how otherwise would you delete them). If on the other hand you don't pass notification ARNs at all to the SDK (e.g `undefined`), it will preserve them. This is the correct behavior and CDK should follow suite. This does however create a (maybe) quirky API ergonomic where in order to remove notification ARNs, one must pass `[]` instead of simply omitting the property. This stems from the fact notification ARNs are not managed through the template, but rather through imperative actions. So it seems reasonable al things considered. ### Description of how you validated changes Added both unit and integration tests. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Describe the bug
A change was introduced in v2.160.0 which appears to be wiping the
notificationARNs
property on a CloudFormation stack whencdk deploy
is run against an existing stack with that property set. This represents a regression on previous behaviour.Regression Issue
Last Known Working CDK Version
2.159.1
Expected Behavior
cdk deploy
does not modify thenotificationARNs
property on existing deployed stacksCurrent Behavior
cdk deploy
wipes thenotificationARNs
property where it is set on existing deployed stacksReproduction Steps
Deploy a stack. Modify the
notificationARNs
property outside of CDK. Then deploy a subsequent update viacdk deploy
Possible Solution
No response
Additional Information/Context
We have an internal tooling platform which stacks can be registered with in order to provide deployment updates. In order to do this, the tool sets the
notificationARNs
property on the stack to listen to stack updates via SNS. Previously updating these stacks viacdk deploy
did not conflict with that, but it does in recent versions.CDK CLI Version
v2.167.1
Framework Version
No response
Node.js Version
18
OS
Mac OS
Language
TypeScript
Language Version
5.x
Other information
No response
The text was updated successfully, but these errors were encountered: