Is there a way to mark a resource to only be run o...
# general
h
Is there a way to mark a resource to only be run once? For example, I want to start an AWS elastic beanstalk app with a sample application right away. From then on, I would like to deploy outside of pulumi. Of course I could add and remove code each time, but I’d be interested in a more automated approach. Maybe using a conditional configuration option?
s
yes, you could choose only the
sample
stack to have that beanstalk app One way to do that could be to have a larger project with different deployment stacks, and
pulumi.get_stack()
can tell you if you want to run certain things, OR simply have different values in your
yaml
file for each associated stack. When deploying the
sample
stack you would have the beanstalk app, and for
production
it wouldn't include it, but would not tear down `sample`'s app
h
In the JS runtime, can conditionals prevent code branches from being included in state?
I’m not even sure what it means to remove a beanstalk application version from state. So I’ll try that out before anything.
l
I think the idiomatic approach would be to have a project only for that app, and run it only after the larger outer project.