You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow parallel deploys of same component across different root stacks and tfstate buckets #225
Allow parallel deploys of same component across different root stacks
Terragrunt, for example, will copy the terraform into a separate temporary directory for each terragrunt run.
For example, if we ran these 3 commands today at the same time locally, we'd have different terraform runs trying to save state into the backend that was last initialized which can be devastating.
# atmos terraform eks --stack tenant-use2-dev# TF_DATA_DIR=.terraform-tenant-use2-dev# the `environment` file would contain the workspace `tenant-use2-dev`
components/terraform/eks/.terraform-tenant-use2-dev/environment
# atmos terraform eks --stack tenant-use2-staging# TF_DATA_DIR=.terraform-tenant-use2-staging# the `environment` file would contain the workspace `tenant-use2-staging`
components/terraform/eks/.terraform-tenant-use2-staging/environment
# etc
Expected Behavior
Separate terraform namespace per run like terragrunt
Use Case
See above
Describe Ideal Solution
Match terragrunt
The above description may not be the exact way terragrunt does it but it would be good to see how they do it in order to match it since they have implemented it a while back so it should be a relatively stable spec.
Alternatives Considered
Run commands linearly
or
use atmos workflows to run linearly
or
run in spacelift
Additional Context
N/A
Reacted by Nathanael Beisiegel, Erik Osterman (Cloud Posse) and RB
changed the title [-]Allow parallel deploys of same component across different root stacks[/-][+]Allow parallel deploys of same component across different root stacks and tfstate buckets[/+]on Nov 2, 2022
Yes! This is what I was mentioning in slack the other day. I updated the ticket with this info too. If the TF_DATA_DIR is set to the root stack, then we can do it.
I think we should support this, with the option of TF_DATA_DIR matching the workspace the way we disambiguate it in the S3 state backend.
Similarly, I think we should add a parallel step in the workflows, to support running multiple steps in parallel. Of course, that would depend on this TF_DATA_DIR functionality being implemented first.
Activity
[-]Allow parallel deploys of same component across different root stacks[/-][+]Allow parallel deploys of same component across different root stacks and tfstate buckets[/+]aknysh commentedon Nov 3, 2022
this could be implemented using
TF_DATA_DIRbut with a flag (e.g. inatmos.yaml) to enable/disable the featurenitrocode commentedon Nov 3, 2022
Yes! This is what I was mentioning in slack the other day. I updated the ticket with this info too. If the TF_DATA_DIR is set to the root stack, then we can do it.
cc PePe Amengual (@jamengual)
osterman commentedon Dec 19, 2022
I think we should support this, with the option of
TF_DATA_DIRmatching the workspace the way we disambiguate it in the S3 state backend.Similarly, I think we should add a
parallelstep in the workflows, to support running multiple steps in parallel. Of course, that would depend on thisTF_DATA_DIRfunctionality being implemented first.