Hello, we would like to use multiple Atlantis instances to execute different directories in a repository. Is there any way to do so in 0.15?
We use repo-level atlantis.yaml to define projects. According to Atlantis docs, the file name cannot be set per Atlantis instance:
* atlantis.yaml files must be placed at the root of the repo
* The only supported name is atlantis.yaml. Not atlantis.yml or .atlantis.yaml.
We think the solution could be to have multiple atlantis.yaml-s and set the filename server-side, maybe as an option to atlantis binary. Any other options to "split" a repo between multiple Atlantis instances are much appreciated, please advise.
Hello @atikhono thank you for the question!
Could you provide additional details about why you are looking to run multiple Atlantis instances in a single repository?
I can't really speak to if it is possible or not as I have not tried it myself. A single instance of Atlantis is designed to support multiple separate projects within a single repository. My gut feeling is that while atlantis.yaml would still need to be at the root of the repository, you could likely accomplish this with the regex matching feature of the ID field and using webhooks that post to one instance or the other based off the paths being modified in the PR.
I suspect running multiple instances would create challenges with state locking as each instance would have its own state. Sticking with a single instance is likely going to yield better results.
This is an interesting question that I will try to answer at the best of my abilities since I too want this functionality.
For me one of the reasons is that we use one terraform project for all the environments since we try to make things DRY and we want all the environment to be configure the same except for maybe few differences like instance count, size, tags , url endpoints and such. This is a very common patter in the industry and this pattern plus separated cloud accounts makes it for good isolation and blast radius protection that for some companies is mandatory.
To accommodate this it will be nice to have at the repo level a custom atlantis-${name}.yaml file so you can have one per environment which then will run against a specific atlantis deployment in each account but the catch is that the other atlantis server will respond to the event and will mark the comment command as failed since they do not know about each other(multiple webhooks in the same repo). Currently that is how I have my setup and the devs know about this limitations and they just wait for the plan to be pushed and I have seen some other approaches which are not the best either.
I have a branch for atlantis that solve this problem by way of adding a new parameter when the server is setup to use multiserver=true which will then ignore request of repos were the atlantis-${name}.yaml file does not match the server config in combination with the comment command parameter to target the specific server, in this scenario the custom atlantis.yaml filename is necessary to be able to define different workflow per environments.
This is one reason why you would want a custom atlantis.yaml file, which might not be @atikhono reasons.
Hello @acastle! It's exactly for the same reason as @jamengual explained 👍. Multiple projects deployed to different accounts with terraform code residing in a monorepo.
@jamengual Would you be so kind to publish the branch with the changes, so that I could have a look? Looks like it's not in your public repos. If that's possible, please.
Hi @atikhono.
I need to cleanup my branch before I commit but I can work on it this week and have it ready for you next week if you want to give it a try.
Hi @jamengual have you had time to cleanup the branch? I'm so looking forward to seeing it.
Sorry @atikhono I meant to comment yesterday, you can check out the branch https://github.com/runatlantis/atlantis/tree/multiserver , please keep in mind that is still a POC and need some work on tests, docs and review from other mantainers but it will be nice to have more early feedback.
let me know if you have any question, join our slack at slack and we can chat about it there if you want
This looks like "must have" feature for us, is there anythink I can do to make this to Atlantis?
The branch needs more testing and tests have to be written.
If anyone can help with that, we can make the process faster.
On Sat., Feb. 6, 2021, 7:36 a.m. Jiří Pinkava, notifications@github.com
wrote:
This looks like "must have" feature for us, is there anythink I can do to
make this to Atlantis?—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/runatlantis/atlantis/issues/1273#issuecomment-774495295,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAQ3ERDGL6FH7ANDK2BASWTS5VOYVANCNFSM4UHWWBGA
.
Most helpful comment
Hi @atikhono.
I need to cleanup my branch before I commit but I can work on it this week and have it ready for you next week if you want to give it a try.