cdk.json seems to ignore various options
See original GitHub issue-
I’m submitting a …
- 🪲 bug report
-
What is the current behavior? When I add various settings options to the
cdk.json
file, they don’t seem to be applied when runningcdk synth
. SpecificallypathMetadata
andassetMetadata
To reproduce: make some very basic cdk app (I am currently using python). cdk.json
{
"app": "python3 app.py",
"pathMetadata": false,
"assetMetadata": false,
"versionReporting": false
}
When I run cdk -v synth
I get the following:
cdk.json: {
"app": "python3 app.py",
"pathMetadata": false,
"assetMetadata": false,
"versionReporting": false,
"staging": false
}
merged settings: {
versionReporting: false,
pathMetadata: true,
output: 'cdk.out',
app: 'python3 app.py',
assetMetadata: true,
staging: true,
context: {},
tags: []
}
Clearly you can see the pathMetadata
and assetMetadata
in the cdk.json
but it doesn’t merge into the settings
-
What is the expected behavior (or behavior of feature suggested)? That the
cdk.json
settings be merged into the settings -
What is the motivation / use case for changing the behavior or adding this feature? This is how it should work already
-
Please tell us about your environment:
- CDK CLI Version: 1.3.0
- OS: macOS Mojave
- Language: Python
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Troubleshooting common AWS CDK issues
This topic describes how to troubleshoot the following issues with the AWS CDK.
Read more >cdk deploy / destroy seem to ignore profile - AWS re:Post
Now, I am trying to deploy it to my another profile. If I hardcode account in the code, and specify --profile another ,...
Read more >AWS CDK - How to properly share a generic app/stack across ...
I think this will work but context variables don't seem suited for this use-case, from the CDK documentation they cache all sorts of...
Read more >AWS CDK Pipelines: Real-World Tips and Tricks (Part 2)
Note that the multiple CDK CLI versions can be specified in your pipeline application. The one specified in your package.json is used for...
Read more >How to migrate CDK v1 to CDK v2 in 10 minuets
Theoretically, you just need to remove all the feature flags put on cdk.json in v1, and can check whether you need the new...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, we currently don’t have support for all switches in
cdk.json
and we should!The reason is that in cdk.js all options that has defaults specified (excluding undefined value) will be set after command line arguments are parsed. And in settings.js (class Configuration) there is this code:
so defaultConfig is overriden by userConfig (~/cdk.json) then by projectConfig(cdk.json) and then with commandLineArguments (which includes all defaults specified in cdk.js function parseCommandLineArguments so command line defaults overrides all options specified earlier).