aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.38k stars 3.79k forks source link

cli: diff --change-set flag not configurable via cdk.json #29232

Open ben-bourdin451 opened 4 months ago

ben-bourdin451 commented 4 months ago

Describe the bug

A new flag was introduced as part of #28336

This flag doesn't seem to be set to wanted default value using the cdk.json.

There's also missing documentation about this flag in the CLI reference. Arguably a different issue since it'll be a different repo? I'm not sure how to report that. Feel free to point me in the right direction.

Expected Behavior

Ability to override default value in cdk.json

Current Behavior

Anything set in in the cdk.json will be ignored

Reproduction Steps

  1. Use any stack setup
  2. Run a diff
  3. You'll see the following output on the stack:
Hold on while we create a read-only change set to get a diff with accurate replacement information (use --no-change-set to use a less accurate but faster template-only diff)
  1. Try to override the change-set flag in cdk.json to false
  2. Run diff again

expected: warning message above dissapears actual: still seeing the warning (behaviour hasn't changed)

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.128.0

Framework Version

No response

Node.js Version

v20.11.1

OS

darwin ARM64

Language

TypeScript

Language Version

No response

Other information

No response

andreialecu commented 4 months ago

Piggy backing on this issue to request that the log message be suppressed if the flag is configured explicitly in cdk.json. It just pollutes logs unnecessarily (we have many stacks).

ben-bourdin451 commented 4 months ago

I'm happy to try and solve this myself if someone points me in the right direction. I took a quick look at the code however it's not immediately obvious how/where these flags are passed through via the cdk.json file

andreialecu commented 4 months ago

Opened #29375 with some changes for this.