At One2N, we specialize in helping clients achieve infrastructure reliability and efficiency. Terraform is a key component of our approach as an SRE team. Recently, I integrated Atlantis into the development process for a large-scale client project, streamlining their Terraform workflows and improving security. This guide outlines the process and the benefits Atlantis brings.
Not Published
What is Atlantis?
Atlantis is a powerful tool that enables automation and collaboration in infrastructure management using Terraform. It acts as a pull request (PR) automation tool specifically designed for Terraform workflows. By integrating Atlantis with version control systems like GitLab, teams can manage their infrastructure as code (IaC) efficiently.
Why Use It?
Atlantis streamlines the process of managing Terraform configurations by automating common tasks like terraform plan, apply and destroy through a simple pull request workflow. It ensures that infrastructure changes are reviewed and approved before being applied, thus enhancing the security and stability of the infrastructure.
How Atlantis Works:
Atlantis listens for events triggered by pull requests in the version control system. When a pull request is opened or updated, Atlantis automatically comments on the PR with a plan of the proposed changes. This allows team members to review the changes and provide feedback. Once approved, Atlantis applies the changes to the infrastructure.
Atlantis Deployment in Cluster:
While I used Kubernetes for this client project due to their existing infrastructure, Atlantis also supports deployment on AWS Fargate, Nomad, or even as a standalone server instance. The core concepts remain the same.
1. GCP Service Account
A Service account is created on GCP with the required permissions that Atlantis can perform on GCP.
2. Atlantis Deployment
Our client had an existing Kubernetes cluster – the perfect spot for Atlantis. A simple Helm chart made deployment a breeze.
Customize values.yaml with service account details from Step 1
Atlantis provides documentation on different deployment methods. Refer to their official guides for instructions on Fargate, Nomad, or standalone server setup
3. Getting Connected (DNS):
To ensure Atlantis could communicate with their GitLab, I set up a DNS entry within their preferred cloud DNS provider.
Integration with Gitlab:
Within the client's GitLab repository, I configured a webhook that triggers Atlantis actions based on events like code pushes and merge requests.