feat(cli): cdk diff works for Nested Stacks#18207
Conversation
skinny85
left a comment
There was a problem hiding this comment.
Nice work @comcalvi! While the experience is good, the code needs a few more iterations before we can merge it.
I think it's worth to think about the responsibilities here. I believe most of the problems with the code right now are because too much has been put in the CdkToolkit class. I think we need to spread the responsibilities around, so that the code in each class is smaller, and easier to understand.
skinny85
left a comment
There was a problem hiding this comment.
This is shaping up better, but I think the production code needs some more polish.
Also, this is the experience I see when going from new sns.Topic(this, 'Topic'); to
this.topic = new sns.Topic(this, 'Topic', {
topicName: 'myFifoQueue',
fifo: true,
contentBasedDeduplication: true,
});Stack UsingNestedStacks
Resources
[~] AWS::CloudFormation::Stack SnsNestedStack.NestedStack/SnsNestedStack.NestedStackResource SnsNestedStackNestedStackSnsNestedStackNestedStackResourceAB4E8721
└─ [~] Resources
└─ [~] .TopicBFC7AF6E:
└─ [+] Added: .Properties
I don't think that's expected, right? (I would expect to see the values of the properties) Probably needs some work there too.
skinny85
left a comment
There was a problem hiding this comment.
This is getting closer, but still needs some work.
The part I'm most unsure of is changing the formatObjectDiff() code, and how it changes the rendered diff, and whether the way we handle the nested stacks, by just jamming the entire template in place of the resource, will give us the correct classes from running diff that we need for hotswapping.
ff137fd to
d735ce4
Compare
fffe982 to
2b0ca60
Compare
skinny85
left a comment
There was a problem hiding this comment.
Looks almost perfect! Just a few last finishing touches, and we will get this merged.
9b78354 to
6f614b7
Compare
6f614b7 to
54ba003
Compare
cdk diff works for Nested Stacks
packages/aws-cdk/lib/cdk-toolkit.ts
Outdated
| for (const stack of stacks.stackArtifacts) { | ||
| stream.write(format('Stack %s\n', chalk.bold(stack.displayName))); | ||
| const currentTemplate = await this.props.cloudFormation.readCurrentTemplate(stack); | ||
| const currentTemplate = await this.props.cloudFormation.readCurrentTemplateWithNestedStacks(stack); // TODO; renmae |
There was a problem hiding this comment.
Can we remove the ToDo then...? 🙂
|
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
* origin/master: (27 commits) chore(eks): deprecate older versions of EKS (aws#18842) fix(tooling): update vscode devcontainer image (aws#18455) chore: npm-check-updates && yarn upgrade (aws#18832) chore(docs): Fix broken md links (aws#18384) chore(lambda-layer-awscli): install awscli with pip and requirements.txt (aws#18800) fix(aws-appsync): Strip unsupported characters from Lambda DataSource (aws#18765) feat(cfnspec): cloudformation spec v55.0.0 (aws#18827) docs(cfnspec): update CloudFormation documentation (aws#18826) chore(cxapi): plugin context provider limited by cx schema (aws#18709) feat(iotevents): add grant method to Input class (aws#18617) chore(cx-api): break circular dependencies (aws#18767) docs(core): clarify that `addOverride` does not change property casing (aws#18687) feat(s3-deployment): deploy data with deploy-time values (aws#18659) docs(cfnspec): update CloudFormation documentation (aws#18808) feat(cli): `cdk diff` works for Nested Stacks (aws#18207) docs(cfnspec): update CloudFormation documentation (aws#18783) chore(lambda-layer-awscli): add update mechanism for AWS CLI (aws#18780) chore(release): 1.143.0 feat(fsx): add support for FSx Lustre Persistent_2 deployment type (aws#18626) feat(amplify): support performance mode in Branch (aws#18598) ...
`cdk diff` now compares all template objects (Resources, Outputs, etc) across nested stacks. Closes aws#5722. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
cdk diffnow compares all template objects (Resources, Outputs, etc) across nested stacks.Closes #5722.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license