-
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
fix(toolkit): 'cdk deploy' support updates to Outputs #2029
Conversation
If only stack Outputs are changed, CloudFormation generates a ChangeSet that is executable but has 0 changes. Before, we looked at the amount of changes to say there was nothing to do, but now we look at the actual change set status to determine whether it's an empty change set or not. The effect is that we can now deploy updates even if only Outputs changed. This becomes very important when the only thing changed to a stack is an Output got added because a cross-stack reference was taken by a downstream stack. Fixes #778.
* Its the responsibility of the consumer to replace all calls that | ||
* actually will be called. | ||
*/ | ||
export class FakeSDK extends SDK { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MockSDK
or SDKMock
// tslint:disable-next-line:max-line-length | ||
throw new Error(`Failed to create ChangeSet ${changeSetName} on ${stackName}: ${description.Status || 'NO_STATUS'}, ${description.StatusReason || 'no reason provided'}`); | ||
}); | ||
|
||
if (!ret) { | ||
throw new Error('Change set took too long to be created; aborting'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really a failure mode here? Like... some kind of a timeout?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the question? Can this really happen in practice, can the code path be taken, ...?
* there are changes to Outputs, the change set can still be executed. | ||
*/ | ||
export function changeSetHasNoChanges(description: CloudFormation.DescribeChangeSetOutput) { | ||
return description.Status === 'FAILED' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this 4-space indented?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be.
If only stack Outputs are changed, CloudFormation generates a ChangeSet that is executable but has 0 changes. Before, we looked at the amount of changes to say there was nothing to do, but now we look at the actual change set status to determine whether it's an empty change set or not. The effect is that we can now deploy updates even if only Outputs changed. This becomes very important when the only thing changed to a stack is an Output got added because a cross-stack reference was taken by a downstream stack. Fixes aws#778.
If only stack Outputs are changed, CloudFormation generates a ChangeSet
that is executable but has 0 changes.
Before, we looked at the amount of changes to say there was nothing to
do, but now we look at the actual change set status to determine
whether it's an empty change set or not.
The effect is that we can now deploy updates even if only Outputs
changed. This becomes very important when the only thing changed
to a stack is an Output got added because a cross-stack reference
was taken by a downstream stack.
Fixes #778.
Pull Request Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license.