bitter-petabyte-19907
06/14/2024, 7:24 AMlively-crayon-44649
06/14/2024, 8:01 AMPulumi.dev.yaml
you pass useECS: true
and check if (config.useECS) { ... }
in your code, rather than if (stack === "dev")
etc. Essentially feature-flagging your stack.
• If you have quite a lot of conditions, you might just deploy another stack to the same (e.g.) AWS account that you can clean up later. Stacks are fairly cheap and you can use the full power of your language to share code and configuration as you wish.
• I would argue the program is still declarative -- you are still declaring how the thing "should be", it's just that the desired state is conditional on some facts that won't appear until runtime.
Hope that helps!