There’s not much/anything on the documentation about strategies to deploying to different cloud environments such as dev, staging, prod, etc.
Since these envs are mostly the same, it makes sense to share all the code by default and only do conditions when you have differences.
However, I don’t want to deploy changes I have made to every env at the same time – I want to be able to deploy changes to dev only or staging to verify things work before I deploy to prod. So, there needs to be a way to define which env gets deployed (or diff’d or synth’d).
Am I supposed to use different stacks? Or should I just use ENV variables:
export CLOUD_ENV=prod and
cdktf deploy (and then do if-conditions based on env variables)?
Thanks for the ideas!