Hi all,
I have a problem with how Remote States are handled which are stored in Artifactory. Running terraform v0.14.5.
Setup:
- I have 2 VMs using a single remote tfstate file in Artifactory and two copies of the same terraform files in two different directories on the local filesystem.
- Running
terraform apply
in a loop in one directory with a pause between the runs - Running
terraform taint
on demand in the other directory - In both directories the same remote tfstate file is referenced
Good case:
terraform taint VM1
-
terraform apply
is running recreating VM1 -
terraform apply
is finished terraform taint VM2
-
terraform apply
is running recreating VM2
Bad case:
terraform taint VM1
-
terraform apply
is running recreating VM1 terraform taint VM2
-
terraform apply
is finished - pause
-
terraform apply
is not recreating VM2
Seems the tfstate gets overwritten after terraform apply
is finished even though VM2 has been tainted in the meantime. Any way to prevent this apart from running terraform taint
only when terraform apply
is not running?
Thanks for your help, really appreciated,
Martin