Support `atmos terraform apply --from-plan` with additional flags @duncanaf (#684)
what
- Change argument generation for
atmos terraform apply
to make sure the plan-file arg is placed after any flags specified by the user
why
- Terraform is very picky about the order of flags and args, and requires all args (e.g. plan-file) to come after any flags (e.g.
--parallelism=1
), or it crashes. atmos terraform apply
accepts aplan-file
arg, or generates one when--from-plan
is used. When this happens, it currently puts the plan-file arg first, before any additional flags specified by the user.- This breaks when additional flags are specified, e.g.
atmos terraform apply --from-plan -- -parallelism=1
. In this example, atmos tries to callterraform apply <planfile> --paralellism=1
and terraform crashes withError: Too many command line arguments