This message was deleted.
# atlantis-community
s
This message was deleted.
1
p
it is
--destroy
I think
l
Copy code
Error: unknown flag: --destroy.
p
sorry….you got it right
-- -destroy
l
it appears when I pass the -d flag, atlantis dosen’t read the — -destroy
when I run
atlantis plan -d somepath/myresource.hcl -- -destroy
p
are you passing COMMENT_ARGS to your custom workflow?
l
No, do you hava any documentation speaking about?
my repos.yaml
Copy code
repos:
- 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
Copy code
COMMENT_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.
if you enable debug you should be able to see the command that is being executed
l
But atlantis dosen’t have an extra arg for destroy, should I put --destroy in the plan arg?
p
I do not know how terragunt works but if this supports
Copy code
terragrunt plan -input=false -out=$PLANFILE -destroy
then you need to pass the comment_ARGS
atlantis does not have a
destroy
command
l
It works the same way as terraform
But every time that I run plan, the --destroy flag is going to run?
p
no
those are passed in the comment
if you do not pass them it will be empty
that is why I said, enable debug and look at the command is running when you add
-- -destroy
and see if is passing it, if is not you will need add the
COMMENT_ARGS
to your custom workflow
l
Copy code
{"level":"debug","ts":"2023-02-27T19:34:37.823Z","caller":"models/shell_command_runner.go:93","msg":"starting \"terragrunt plan -input=false -out=$PLANFILE\
only running this
p
and then is when you added the destroy flag?
l
One question PePe, the COMMENT_ARGS goes in the workflow env, the documentation is not very clear
l
This workaround currently works, but I don’t think it fits for the reality that I’m into. Anyway, thanks for answering me!
p
why it does not fit?
l
Because we need to find de PR or change the file to run the delete command, then push the code
p
change which file? the Atlantis.yaml?
l
the terragrunt.hcl file, to create an “Delete Pull Request”
then merging to master
I think I will need some script to remove the files with a post_workflow hook
p
I c ok, I’m not familiar with terragrunt but this in pure TF works fine
l
Sounds cool, we’re running a few tests with atlantis and terragrunt, but the solution unlocked my work. Thanks PePe, anything you need, feel free to reach me out 🙂