Atlantis: Feature Suggestion - Allow `atlantis plan` for all defined projects regardless of files changed

Created on 6 Sep 2018  路  9Comments  路  Source: runatlantis/atlantis

It would be great if we can do atlantis plan which will do plan for all projects defined in atlantis.yaml regardless whether files have changed or not.

This could be done as an extra argument flag for example

atlantis plan --ignore-file-change

This is helpful when teams want to revert manual changes done on the cloud infra to the infrastructure code on multiple projects in a monolith terraform repo.

Current workaround is for teams to do a minor change to the file (new line etc) on each directory and trigger it from there.

feature

Most helpful comment

I think I'd like to do it via the terragrunt-style command atlantis plan-all

All 9 comments

I think I'd like to do it via the terragrunt-style command atlantis plan-all

I would also love to see this. I though the purpose of "when_modified" was to limit planning to only plan when certain files were changed. It would follow then that excluding this from the atlantis.yaml and having autoplan=true would result in "atlantis plan" with no other arguments doing a plan on all projects.

So I'd actually think simply "atlantis plan" should just plan everything that is set to autoplan, if not everything.

I have a lot of objects for managing our github org, planning all by default would basically make it impossible for us to use as we would not be able to work within the rate limits of github. I am 馃憤 to make it an option such as atlantis plan-all as Kyle suggested but it needs to be opt in behavior

@ahartma1, if when_modified is omitted, Atlantis defaults to using the normal Atlantis algorithm for determining where to run plan. It does this because I wanted to have sane defaults for the keys that people don't set in atlantis.yaml.

If you want it to plan everything you could set it to:

projects:
- dir: .
  when_modified: [**/*]

Or if your project was in another dir:

projects:
- dir: mydir
  when_modified: [../**/*]

Has there been any progress on this at all?

We are trying to implement atlantis across all of our repositories, and it makes it quite difficult to test without a command like this

Has there been any progress on this at all?

We are trying to implement atlantis across all of our repositories, and it makes it quite difficult to test without a command like this

This request regards mono-repos where all your Terraform is co-located in a flat, root-based structure. I'm not sure how the requested functionality could help in a muliti-repo setup. Atlantis is premised on the fact that you are using a merge request as a vehicle of change management, so automatically doing a plan-all for many repos doesn't make a lot of sense to me as Atlantis doesn't create merge requests for you, and wouldn't know which branch to plan upon even if it did. If you need to run terraform plans on all your repositories at once, you should probably build your own automation into another repo, which could reach out to the other repos, plan them, and detect changes.

I still think that @lkysow maybe, respectfully, misses the purpose of the request. His response above is still predicated on a file somewhere changing. I think what is being requested is a --force-plan-all option which would plan every root defined in the Atlantis.yaml even if no files anywhere had changed. The purpose would be to detect drift on the resources, or to see whether an version-unbound provider update will introduce a change to the infrastructure or a breaking change to the code due to previously deprecated arguments in the terraform. I'm not so sure that this is how @lkysow envisioned the tool being used though. I would be curious if Terraform Enterprise answers any of these challenges, given that @lkysow now works there. In any case I recommend that you dont rely on atlantis for simply detecting drift. Keep your code up to date and your hands out of the cookie jar by not allowing the team to make manual changes, or build in your own auto-planning mechanism that plans each branch either upon push, or maybe on a schedule, if you simply want to detect drift.

Sorry - I wasn't very clear above... I'm not requesting the ability to plan every repo from a single command, rather the ability to ask atlantis to run a plan for every project defined in a specific repo level atlantis.yaml file.

Essentially we are looking for a way to validate our configuration files, IAMs etc by checking that a plan on master returns no diffs for each terraform project in the repo.

I'd like to suggest a (somewhat?) related feature - rather than planning a single project or all projects, I'd like the ability to group projects and execute bulk plans and applies against that group.

In the case of plan all - we are currently up to around 200 projects, so a plan-all would take a very long time to execute as well as running into all sorts of issues with locks. On the other hand, when I make an update that applies to an environment (35-40 projects) or all projects, being able to run those 35-40 projects at a time with a single command would be a lot nicer than the current workflow of doing 1 at a time.

We would also love this feature for same reasons as listed by @mbamber

Was this page helpful?
0 / 5 - 0 ratings

Related issues

younus2019 picture younus2019  路  4Comments

majormoses picture majormoses  路  3Comments

timoguin picture timoguin  路  6Comments

teosoft123 picture teosoft123  路  5Comments

cheethoe picture cheethoe  路  4Comments