See https://twitter.com/antonbabenko/status/959435367001845760 for a use-case.
Probably implement this via atlantis.yaml or via a specific comment format that allows users to customize how we run terraform plan or terraform apply.
Right now users can add additional arguments to those commands by just appending the args to atlantis plan/apply -additional-arg but they can't change the first part we run: terraform plan/apply
I could change the part to run instead of terraform by aliasing it to my shell script which sets IAM role and calls terragrunt instead, but it does not look great especially since Atlantis adds some arguments as well (like -no-color).
Yeah that wouldn't work right now because like you said we add in our own options that aren't overrideable.
I think what I'll end up doing is having the exact sequence of commands that run on plan/apply configurable (but with sane defaults) to support your use-case. I'm in the middle of redesigning Atlantis 0.3 to make it way more configurable to support exactly these kinds of use-cases. It's not a simple redesign so I won't be able to support this right away. I'm targeting next week to have a rough draft of how things would look and then I'd love to get your feedback.
Note to myself, see also discussion in https://github.com/hootsuite/atlantis-tests/issues/523#issue-296007866 for example project layout and request to make additional commands available in atlantis like atlantis plan-all
I would also be interested in using this with our existing Terragrunt repositories
Almost there with this. With the latest 0.4 release all the commands can be customized but I need to make the expected plan filename available as an environment variable so that it can be output to the right place.
Fixed in 0.4.1. The expected location of the planfile is set via the $PLANFILE environment variable. This allows overriding the plan command with an atlantis.yaml file, for example:
version: 2
projects:
- dir: mydir
workflow: customworkflow
workflows:
customworkflow:
plan:
steps:
- init
- run: terraform plan -out $PLANFILE
@mholttech see this issue for an example of how I got terragrunt working: https://github.com/runatlantis/atlantis/issues/177 Please let me know if it works as you'd like for your set up.
Most helpful comment
I would also be interested in using this with our existing Terragrunt repositories