Hello team! I'm sorry if this question is basic - ...
# atmos
a
Hello team! I'm sorry if this question is basic - I've recently inherited a large Atmos-based IAC codebase and am still trying to wrap my head around it. It is less than a year old. I made some changes that touch multiple components, and would like to
apply
my PR changes to all affected stacks in our
staging
stage. For context, our stack naming use the general best practice:
{tenant}-{environment}-{stage}
(i.e.
plat-use1-staging
). To do that, I want to write a simple GHA workflow that applies changes to all stacks suffixed with
-{stage}
(i.e.
staging
) on demand. I come from a traditional Terraform background, where we used TF workspaces as environments (
prod
,
stage
,
dev
). Just wanted to double-check with you wether that idea is common amongst Atmos users, and whether I'm thinking about Atmos stacks correctly. Thank you for any tips. 🙏
e
Atmos uses workspaces too :-) (by default at least)
Have you seen the the
--affected
Flag we introduced for plan and apply?
a
Yes, I will be using the change detection built into Atmos, my question is just whether executing automated partial applies on filtered lists of stacks (i.e. per environment) is a common practice in Atmos CI/CD flows. I can see that our workflows already use the ones shared in Atmos docs, but I can't see one supporting environment (stage) previews/applies.
e
It was actually introduced more for local execution, but will work in CI/CD if you don’t care for reviewing and approving plans
We (Cloud Posse) use a separate process involving a GitHub action for affected stacks that allows us to approve the plan of an affected component before applying it
Do you have GitHub enterprise?
a
We use the entire setup from here pretty much 11 https://atmos.tools/integrations/github-actions/
e
Aha
So that already works with affected stacks in a matrix
Let’s take a step back: what’s the non technical goal?
a
The goal is to be able to deploy an infra change affecting multiple components to a staging environment from CI. This is to verify that the apply step will execute correctly before we roll it our to production.
e
Do you have GitHub enterprise?
a
Yes I believe so.
e
Great. So the overall strategy we use is to decouple release from deploy. Release is when an environment is updated and deploy is when changes are merged into a branch like main. We have a PR on this topic open. I need to step away but will get back .
a
Thanks. I don't think we need to change our strategy to accomodate this feature, but would love to keep doing things the "Cloudposse"-way if possible. Hence the question.
e
I will share the doc as soon as we publish it
🙌 1
a
Thank you for your time @Erik Osterman (Cloud Posse), will keep my eyes out. 👀