https://pulumi.com logo
#general
Title
# general
h

high-holiday-63390

11/08/2021, 7:23 PM
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

salmon-raincoat-19475

11/08/2021, 7:33 PM
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

high-holiday-63390

11/08/2021, 7:41 PM
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

little-cartoon-10569

11/08/2021, 7:48 PM
I think the idiomatic approach would be to have a project only for that app, and run it only after the larger outer project.