You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Issue # (if applicable)
Closes#17942.
### Reason for this change
The CDK CLI shows the stack template, which includes the CFN Rule `CheckBootstrapVersion`. This rule will fail a deployment if the bootstrap is not right. Customers think this rule is an error message.
### Description of changes
Obscure this `CheckBootstrapVersion` Rule from the template when we print it, if it exists. If it is the only Rule, remove the `Rules` section entirely.
### Description of how you validated changes
Manual testing, unit tests, and CLI 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*
Note that the CDK::Metadata resource and the `CheckBootstrapVersion` Rule are excluded from `cdk diff` by default. You can force `cdk diff` to display them by passing the `--strict` flag.
169
+
168
170
The `change-set` flag will make `diff` create a change set and extract resource replacement data from it. This is a bit slower, but will provide no false positives for resource replacement.
169
171
The `--no-change-set` mode will consider any change to a property that requires replacement to be a resource replacement,
170
172
even if the change is purely cosmetic (like replacing a resource reference with a hardcoded arn).
Copy file name to clipboardExpand all lines: packages/aws-cdk/lib/cli.ts
+1-1
Original file line number
Diff line number
Diff line change
@@ -260,7 +260,7 @@ async function parseCommandLineArguments(args: string[]) {
260
260
.option('exclusively',{type: 'boolean',alias: 'e',desc: 'Only diff requested stacks, don\'t include dependencies'})
261
261
.option('context-lines',{type: 'number',desc: 'Number of context lines to include in arbitrary JSON diff rendering',default: 3,requiresArg: true})
262
262
.option('template',{type: 'string',desc: 'The path to the CloudFormation template to compare with',requiresArg: true})
263
-
.option('strict',{type: 'boolean',desc: 'Do not filter out AWS::CDK::Metadata resources or mangled non-ASCII characters',default: false})
263
+
.option('strict',{type: 'boolean',desc: 'Do not filter out AWS::CDK::Metadata resources, mangled non-ASCII characters, or the CheckBootstrapVersionRule',default: false})
264
264
.option('security-only',{type: 'boolean',desc: 'Only diff for broadened security changes',default: false})
265
265
.option('fail',{type: 'boolean',desc: 'Fail with exit code 1 in case of diff'})
266
266
.option('processed',{type: 'boolean',desc: 'Whether to compare against the template with Transforms already processed',default: false})
0 commit comments