atlantis
atlantis copied to clipboard
Infer apply order from atlantis.yaml
I have a problem with the order of modules getting applied.
This might not be an issue with pure terraform, but the setup is using terragrunt.
All dependencies are described correctly in my atlantis.yaml file.
Maybe it is possible to infer the order in which applies should be triggered by reading the config file and applying those modules, that others in an MR depend on, first?
I am willing to help out on implementing this if this is a feature that seems beneficial to the overall project and you could give me some pointers.
Example
- VPC
- Worker Instance -> WI
- Networking Rules -> NR
Both NR and WI depend on the VPC. Apply VPC first.
WI depends on NR. Apply NR next.
Apply WI last.
In atlantis.yaml form
When VPC changes, update both WI and NR -> apply first
When NR changes, update WI -> apply first
Yes this would be nice. Also I am a little annoyed with that changes in dependencies are not shown in plans, in the example above an atlantis plan would show "no changes" in NR and WI would not be visible until VPC is applied. I understand that terraform need to update the output (which it does at apply) before it can get the those values to input in the dependee..
This could either be solved by applying them all in order as suggested here (and then not only show "apply succesfull" but show what actually has changed in the apply, since it would not be shown in the earlier plan..
It could also be nice to run an extra plan after each apply.. and only show results if there are any new changes.
Good idea! For the plan issue, an option to wait for dependencies to plan the modules would be nice indeed. Apply could trigger automatically the remaining plans of any module depending on this apply as well.
@lkysow What do you think?
I wouldn't start on this if its not desired in the project :)
This would be a great feature to have. My team was just discussing if there was a way to have atlantis apply dev before it applies prod even though maybe atlantis apply was the only thing in the comment. Or having an exception in the server config file that for a specific stage atlantis apply needs to be explicit or it wont run.
if atlantis had an API, you could read the apply status, and using the github api to write the specific apply comments.
I've always wanted an apply order or dependency graph
Hi, do we have this feature enabled now?
Hi i'm needing this feature, is enabled?
is this still relevant needed or tested with v0.19.8?
I believe this is now implemented with execution_order_group
https://www.runatlantis.io/docs/repo-level-atlantis-yaml.html#order-of-planning-applying