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!No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by