Luiz Silva
02/27/2023, 5:56 PMatlantis plan -d somepath/myresource.hcl -- -destroy
◦ atlantis apply
The atlantis pipeline is running the plan to create the resource, instead of running the destroy. Do you guys know how can I solve this problem?
I’m currently running my atlantis in v0.21.0
Thanks in advance 🙂PePe Amengual
02/27/2023, 5:58 PM--destroy
Luiz Silva
02/27/2023, 5:59 PMError: unknown flag: --destroy.
PePe Amengual
02/27/2023, 5:59 PM-- -destroy
Luiz Silva
02/27/2023, 6:00 PMatlantis plan -d somepath/myresource.hcl -- -destroy
PePe Amengual
02/27/2023, 7:17 PMLuiz Silva
02/27/2023, 7:24 PMrepos:
- id: "/.*/"
workflow: terragrunt
workflows:
terragrunt:
plan:
steps:
- env:
name: TERRAGRUNT_TFPATH
command: 'echo "terraform${ATLANTIS_TERRAFORM_VERSION}"'
- run: terragrunt plan -input=false -out=$PLANFILE
- run: terragrunt show -json $PLANFILE > $SHOWFILE
apply:
steps:
- env:
name: TERRAGRUNT_TFPATH
command: 'echo "terraform${ATLANTIS_TERRAFORM_VERSION}"'
- run: terragrunt apply -input=false $PLANFILE
PePe Amengual
02/27/2023, 7:26 PMCOMMENT_ARGS - Any additional flags passed in the comment on the pull request. Flags are separated by commas and every character is escaped, ex. atlantis plan -- arg1 arg2 will result in COMMENT_ARGS=\a\r\g\1,\a\r\g\2.
Luiz Silva
02/27/2023, 7:29 PMPePe Amengual
02/27/2023, 7:31 PMterragrunt plan -input=false -out=$PLANFILE -destroy
then you need to pass the comment_ARGSdestroy
commandLuiz Silva
02/27/2023, 7:31 PMPePe Amengual
02/27/2023, 7:32 PM-- -destroy
COMMENT_ARGS
to your custom workflowLuiz Silva
02/27/2023, 7:35 PM{"level":"debug","ts":"2023-02-27T19:34:37.823Z","caller":"models/shell_command_runner.go:93","msg":"starting \"terragrunt plan -input=false -out=$PLANFILE\
PePe Amengual
02/27/2023, 7:36 PMLuiz Silva
02/27/2023, 8:24 PMPePe Amengual
02/27/2023, 8:37 PMLuiz Silva
02/27/2023, 9:57 PMPePe Amengual
02/27/2023, 10:06 PMLuiz Silva
02/27/2023, 10:12 PMPePe Amengual
02/27/2023, 10:17 PMLuiz Silva
02/27/2023, 10:54 PMPePe Amengual
02/27/2023, 11:05 PMLuiz Silva
02/28/2023, 2:01 AM