Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make exact plan/apply command configurable #4

Closed
lkysow opened this issue Feb 8, 2018 · 7 comments
Closed

Make exact plan/apply command configurable #4

lkysow opened this issue Feb 8, 2018 · 7 comments
Milestone

Comments

@lkysow
Copy link
Member

lkysow commented Feb 8, 2018

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

@antonbabenko
Copy link
Contributor

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).

@lkysow
Copy link
Member Author

lkysow commented Feb 11, 2018

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.

@lkysow
Copy link
Member Author

lkysow commented Feb 11, 2018

Note to myself, see also discussion in hootsuite/atlantis-tests#523 (comment) for example project layout and request to make additional commands available in atlantis like atlantis plan-all

@lkysow lkysow added this to the 0.4 milestone Mar 15, 2018
@mholttech
Copy link

I would also be interested in using this with our existing Terragrunt repositories

@lkysow
Copy link
Member Author

lkysow commented Jul 4, 2018

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.

@lkysow
Copy link
Member Author

lkysow commented Jul 10, 2018

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

@lkysow lkysow closed this as completed Jul 10, 2018
@lkysow
Copy link
Member Author

lkysow commented Jul 10, 2018

@mholttech see this issue for an example of how I got terragrunt working: #177 Please let me know if it works as you'd like for your set up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants