Hi, atmos terraform `apply` and `plan` have an `-...
# atmos
e
Hi, atmos terraform
apply
and
plan
have an
--all
flag to deploy all components in a stack. However, I did not see that
init
and
destroy
have an
--all
flag as well. Will it be added in the future? Because if I want to delete all components in a stack, I have to do it one by one. If I'm using:
Copy code
provision:
        backend:
          enabled: true
Atmos would create the S3 bucket for the backend. It only works with
init
first, so
apply
and/or
plan
do not work and throw an error that the backend does not exist. In this case, I also have to
init
each component in the stack, so adding an
--all
flag to
init
would be beneficial.
e
But init is a book for both plan and apply, so it will always run. And backend provisioning is a hook on init. There when you run any of those commands, you are guaranteed to get a backend when enabled.
As for adding the flag on the rest of the commands, makes sense. Could I trouble you to open an issue?
(Also just a heads up, there's a bug in the all flag right now whereby it's not in dependency order. We are working on a longer term fix)
e
@Erik Osterman (Cloud Posse) I know, I reported this bug 🙂 Regarding my issue, unfortunately this is not the case from what I see. Using terraform plan --all -s dev-ue1 returns an error NoSuchBucket. This works without the --all flag so this is another bug with the --all flag I assume. Init does not work with --all.
e
Aha, that would be the smoking gun. Let us check.
e
Thank you!
e
If you have the chance, can you help me validate this?
Rerun the same command, add the flag
--use-version=2257
I have not verified this.
e
It did solve the issue of the backend provisioning. I'll wait for news on the other bug I discovered, the components still provision in a random order and do not adhere to the dependencies. Thank you.
e
Possible stop-gap: If you use
--affected
instead of
--all
it will be independency order