We all want to use it together!
Terraform is a great system for managing infrastructure server as code. We've seen that it lets you perform complex operations using nothing but a descriptive structure.
Atlantis https://www.runatlantis.io/ lets you have a shared git repository and manage changes to the infrastructure using what is by now a standard workflow in software development: pull requests.
How does it work?
The basic idea is that the only one running Terraform commands is the Atlantis server itself.
This way we can "lock" projects and make sure two people can't request changes to the same infrastructure at the same time.
An Atlantis project is in fact made up of many "sub-projects" inside the repository. These sub-projects are managed through a dedicated file in the root of the project called atlantis.yaml.
Let's now take a quick look at an infographic on how Atlantis works, taken straight from their documentation:
[image: image not recovered]
With that said, let's list what we need to have a working environment.
Requirements
To use Terraform with Atlantis, you need a few essential things:
- An Amazon S3 bucket to store the Terraform state (or another compatible remote storage).
- a VM or a Docker container to run Atlantis on.
- a repository on Github, Bitbucket or Gitlab.
Why should I use it? Hashicorp offers its own enterprise suite
That's exactly the reason: Hashicorp has its own solution for using Terraform in a team, the problem is that it's a proprietary solution and the costs are prohibitive for a small or medium-sized company.
What are the differences?
Terraform Enterprise has on its side a set of tools that make some issues easier to handle. For example, secrets management comes with good permission granularity.
In Atlantis secrets management is more complicated because there's no native way to do it. You can use tools like git-crypt (https://github.com/AGWA/git-crypt), environment variables, external parameter management solutions like Amazon parameter store, or other custom solutions.
Terraform Enterprise also lets you manage policies on the Terraform code being written, and you can manage private Terraform modules and their versioning directly within their platform.
Conclusions
Personally I enjoy working with Atlantis, both for its versatility and because it's Open Source software. For team work you need to make sure that the versioning system you're using (BitBucket, Github, Gitlab) handles pull request approvals, and also make sure you have a secure way of managing secrets (if you're going to use secrets in your Terraform projects)
Write me your questions and doubts in the comments, I'll get back to you as soon as possible!
See you next time! :)