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
Hi,
I created a custom workflow for terragrant and tried to use plan/apply-all, by passing $PLANFILE as parameter workflows: terragrunt: plan: steps: - env: name: TERRAGRUNT_TFPATH command: 'echo "terraform${ATLANTIS_TERRAFORM_VERSION}"' - run: terragrunt plan-all --terragrunt-non-interactive -no-color -out $PLANFILE apply: steps: - env: name: TERRAGRUNT_TFPATH command: 'echo "terraform${ATLANTIS_TERRAFORM_VERSION}"' - run: terragrunt apply-all $PLANFILE --terragrunt-non-interactive -no-color
But I noticed that only the latest plan was applied. What happens is that terragrunt passes the same absolute file path to all the children and the latest plan wins. The simple solution was just let terragrunt work with file name only workflows: terragrunt: plan: steps: - env: name: TERRAGRUNT_TFPATH command: 'echo "terraform${ATLANTIS_TERRAFORM_VERSION}"' - run: terragrunt plan-all --terragrunt-non-interactive -no-color -out default.tfplan apply: steps: - env: name: TERRAGRUNT_TFPATH command: 'echo "terraform${ATLANTIS_TERRAFORM_VERSION}"' - run: terragrunt apply-all "default.tfplan" --terragrunt-non-interactive -no-color
This works fine if run from the command line, but in Atlantis it worked only if run "atlantis -d
". After checking the code, I found out that there was a bug/limitation introduced as part of #487.
IMO, Atlantis code shouldn't have workarounds for specific terragrunt implementation or at least support flags to enable/disable different behavior.
That PR initially failed due to $PLANFILE example from Atlantis documentation. I suggest to fix the documentation (i.e. don't use $PLANFILE for terragrunt), add compatibility flag to support the current plan search logic and remove this exception (ignoring .terragrunt-cache) from the future versions.
The text was updated successfully, but these errors were encountered:
Hi,
I created a custom workflow for terragrant and tried to use plan/apply-all, by passing $PLANFILE as parameter
workflows: terragrunt: plan: steps: - env: name: TERRAGRUNT_TFPATH command: 'echo "terraform${ATLANTIS_TERRAFORM_VERSION}"' - run: terragrunt plan-all --terragrunt-non-interactive -no-color -out $PLANFILE apply: steps: - env: name: TERRAGRUNT_TFPATH command: 'echo "terraform${ATLANTIS_TERRAFORM_VERSION}"' - run: terragrunt apply-all $PLANFILE --terragrunt-non-interactive -no-color
But I noticed that only the latest plan was applied. What happens is that terragrunt passes the same absolute file path to all the children and the latest plan wins. The simple solution was just let terragrunt work with file name only
workflows: terragrunt: plan: steps: - env: name: TERRAGRUNT_TFPATH command: 'echo "terraform${ATLANTIS_TERRAFORM_VERSION}"' - run: terragrunt plan-all --terragrunt-non-interactive -no-color -out default.tfplan apply: steps: - env: name: TERRAGRUNT_TFPATH command: 'echo "terraform${ATLANTIS_TERRAFORM_VERSION}"' - run: terragrunt apply-all "default.tfplan" --terragrunt-non-interactive -no-color
This works fine if run from the command line, but in Atlantis it worked only if run "atlantis -d
". After checking the code, I found out that there was a bug/limitation introduced as part of #487.IMO, Atlantis code shouldn't have workarounds for specific terragrunt implementation or at least support flags to enable/disable different behavior.
That PR initially failed due to $PLANFILE example from Atlantis documentation. I suggest to fix the documentation (i.e. don't use $PLANFILE for terragrunt), add compatibility flag to support the current plan search logic and remove this exception (ignoring .terragrunt-cache) from the future versions.
The text was updated successfully, but these errors were encountered: