This message was deleted.
s
This message was deleted.
a
These are supposed to be ephemeral stacks, right? That is, they'll live just for the duration of the CI/CD pipeline on that branch. If yes, have you gotten into issues with
pulumi stack init $stack_name
where
$stack_name
is derived from the branch name or the CI/CD build number?
d
Correct, ephemeral stacks! I never even considered to perform an init inside the pipeline, but that makes a lot of sense. Are you saying that I should check the stack does not exists before trying to init?
a
Probably the command suggested in that thread is better. Select stack or create if it doesn't exist yet:
pulumi stack select --create foo
.
You might be interested in this presentation too:

https://www.youtube.com/watch?v=jAQhDZiRzBQ

d
Thanks @able-beard-29160 that's exactly what I was looking for, I am just a newbie with pulumi and gcp (I am a Terraform + Aws + Kubernetes person :D)
Is there anything in that video that is particularly interesting in your opinion?
a
I'm a beginner with Pulumi as well, so the video served more as a confirmation that what I'm trying to implement isn't a crazy thing.
c
Shameless plug, but @brief-school-94535 and I will be giving a talk on infrastructure testing using Pulumi and CircleCI tomorrow! And will be covering this topic as well. Registration info: https://www.pulumi.com/webinars/verify-your-infrastructure-on-deployment/?utm_content=buffer96c28&utm_medium=SCC&utm_source=Twitter&utm_campaign=Twitter-Buffer-Csy As for the question of “ephemeral, per-branch stacks”… there are a lot of things to consider and tradeoffs you may or may not want to make. As a beginner with Pulumi, I’d suggest you just hook up a couple of “well known” branches and stacks. e.g. pushes to
master
/`main` updating a
testing
stack, pushes to
production
updating a
production
stack, and so on. If you want to create a Pulumi stack specifically for testing things during the lifecycle of a pull request (like Angel and I will cover, or in that CNCF talk Ionut linked to), that’s possible… but ultimately tied to whatever CI/CD system you have and the sort of hooks you can use. (So it can be difficult to set up.) But it’s definitely an area that we at Pulumi are working on and will be continuing to publish examples and documentation for how to do this with various CI/CD providers. Since enabling infrastructure testing is one of the major advantages to infrastructure as code, and Pulumi!
… And if anybody is interested in learning more about this topic, such as “confirmation that what I’m trying to implement isn’t a crazy thing” and/or what options are available for scripting the Pulumi CLI. I’m happy to help out, just shoot me a private message and we can figure out a good time to video chat or something 🙂
d
Thanks @colossal-beach-47527. Happy to contribute if I can, I have done a lot of this in a ci/cd setting with kubernetes 🙂