(cdk --context): add a --context-override flag for parameters #16026
Labels
feature-request
A feature should be added or improved.
needs-triage
This issue or PR still needs to be triaged.
when using synth or deploy on a project that has an existing cdk.context.json file, the values entered in via the command line from the --context key=value should overwrite/override the existing values in the file if the --context-override flag is added.
Use Case
Allows for easier development of deploy pipelines in other products (like azure). Currently all of the values in the cdk.context.json file have to be updated via file manipulation. So if I have dedicated vpcs, kms keys, etc per environment or I have naming structures for resources that are based on environment naming, having those values in the context makes having dynamic stacks easier to create. However, currently all values in the cdk.context.json file must be updated via file manipulation, which is more work than necessary and a simple flag to indicate those existing values should be overwritten/overrode during synth/deploy time makes the most sense.
Proposed Solution
add a --context-override flag so identically keyed context pairs are overridden by parameters passed via cli instead of having the cdk.context.json file be the "arbiter of truth".
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: