CDK Bootstrap should not try to process cdk.json #23856
Replies: 8 comments
-
@asnaseer-resilient hey, this is intended behaviour. The I'm dropping the bug label and marking this as guidance. Let me know if you have any other questions! |
Beta Was this translation helpful? Give feedback.
-
I understand your reasoning but it still doesn't /feel/ right to me. The less surprising thing would be for bootstrap to be completely independent of any app-specific settings. In my case I have had to put in a workaround where I deleted the |
Beta Was this translation helpful? Give feedback.
-
what's the ideal workflow you would be looking for? we wouldn't be able to drop the current behaviour as there are users that rely on it and it's something that would be breaking backwards compatibility. Is it desirable to have a flag maybe to opt out of inferring the environment? Aside: out of curiosity, why not use the default settings that new cdk projects ship with. that should just work i.e.
|
Beta Was this translation helpful? Give feedback.
-
A flag to opt out of this behaviour would indeed be useful. We do not use the structure generated by the CLI as it doesn't quite fit in with our way of working. I will try and write up a short summary of how we are using the CDK and add it in a comment here later this evening. |
Beta Was this translation helpful? Give feedback.
-
This is how we would have liked to have our project files as:
Relevent snippet from
Contents of
Initial contents of
The The The Our deployment is performed using CircleCI which calls various scripts within our The scripts synth-stack, undeploy-stack, diff-stack, and list-stacks are only run locally as and when needed. The issue we had was that the bootstrap-cdk script was failing because it was trying to process the We were therefore forced to delete the
All of our applications follow the above logic. We felt it was safe for all the applications to call bootstrap-cdk as we assumed this is an idempotent operation. |
Beta Was this translation helpful? Give feedback.
-
This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Beta Was this translation helpful? Give feedback.
-
This seems like a demoware-level feature rather than something to take seriously. If you're going to include such 'magic', please give a way to disable it. |
Beta Was this translation helpful? Give feedback.
-
I managed to disable the automagic inferring of environments (and synthesizing) by specifying an empty app, like this:
|
Beta Was this translation helpful? Give feedback.
-
I noticed that running
cdk bootstrap
causes it to process thecdk.json
file (if one is present). I believe this is a bug as the bootstrap process should have no reason to look at any specific app configuration.Reproduction Steps
We use Typescript and we compile this only when deploying our stack (i.e. when running
cdk deploy
). This means the transpiled Typescript files are not present when runningcdk bootstrap
as follows:cdk bootstrap aws://************/eu-west-2
Error Log
Environment
Snippet of relevant packages in
package.json
:For reference, this is the contents of the
cdk.json
file:This is 🐛 Bug Report
Beta Was this translation helpful? Give feedback.
All reactions