Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli): default command line args override cdk.json when not specified
Previously, pathMetadata, assetMetadata, debug and staging could not be set in `cdk.json` as command-line parameters defaults would always overwrite this. In particular, this `cdk.json` would be ignored: ``` { "app": "npx ts-node --prefer-ts-exts bin/example", ... "pathMetadata": false, "assetMetadata": false } ``` The issue is this piece of code: ``` this.settings = this.defaultConfig .merge(userConfig) .merge(this.projectConfig) .merge(this.commandLineArguments) .makeReadOnly(); ``` `commandLineArguments` returns true for the above mentioned options. This commit is a copy of #21891 which fell through the cracks, so I'm picking up as this can potentially cause outages to resources that have drift under the hood, and adding metadata looks like an `Update` operation to CloudFormation. There are already unit tests around the cli which show that the same behavior works, located here: https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts fixes #3573 shoutout to @berenddeboer who did the work, I'm just reviving it.
- Loading branch information