-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(cli): add --mode options to diff command. deprecates --change-set/--no-changeset #32830
base: main
Are you sure you want to change the base?
Conversation
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.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
0a38fbc
to
c0bf4db
Compare
Clarification Request: Integration test has been added but the linter still doesn't seems too happy. Anything I can do about that? |
c0bf4db
to
8e9f761
Compare
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.
Thanks for getting started on this!
In stead of introducing a new boolean option that only sometimes has an effect, we should create a new 3-way switch option to replace the current --change-set
and --no-change-set
options.
Something like
--mode=auto
--mode=change-set
--mode=template-only
8e9f761
to
e7a536b
Compare
e7a536b
to
95be843
Compare
@mrgrain I have addressed your feedback. Let me know what you reckon |
The pull request linter fails with the following errors:
PRs must pass status checks before we can provide a meaningful review. If you would like to request an exemption from the status checks or clarification on feedback, please leave a comment on this PR containing |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Issue # (if applicable)
Closes #28753
Reason for this change
The current behaviour of implicitly reverting to template-only diff can hide important error messages from the user that can help catching mistakes early before deployment.
This is especially true when a template uses transforms or when using changeset-level cloudformation hooks to enforce compliance rules.
See an example code snippet at the bottom
Description of changes
Added a
--mode
option to thediff
command that replaces (deprecates)--change-set
/--no-changeset
.The following modes are supported:
auto
: Attempts changeset creation and fallback tolocal
mode should any error be encountered. (replaces-change-set
)change-set
: Attempts changeset creation but doesn't handle errors returned by cloudformation when creating a changeset for an existing stack. Instead those errors are surfaced to the usertemplate-only
: Uses template-only diff (replaces--no-change-set
)Description of how you validated changes
Checklist
Example Code
Current behaviour on diff:
New behaviour on diff:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license