In the previous subchapter, we set up a basic pipeline with GitHub Actions. It works very well, but there are specialized tools for the Terraform workflow that make it even more convenient and secure. The most well-known is Atlantis. In this subchapter, you'll understand what it brings to the table and why many teams adopt it to take their infrastructure GitOps to the next level.

Reminder: GitOps

We saw the concept of GitOps in subchapter 12.5: managing infrastructure through Git and Pull Requests, so that every change is proposed, reviewed, and applied via the Git workflow. Atlantis is a tool designed specifically to do GitOps with Terraform as smoothly as possible.

What is Atlantis

Atlantis is an open source tool that automates Terraform directly from Pull Requests, via comments. Instead of the pipeline running plan and apply "on its own," with Atlantis you and your team control those actions by writing comments in the PR itself.

In the Pull Request, you write a comment:
   "atlantis plan"   →  Atlantis runs the plan and posts it as a reply
   "atlantis apply"  →  Atlantis applies the changes (after approval)

Analogy: Atlantis is like an assistant that lives inside your Pull Requests. You give it commands via comments ("plan this," "apply it") and it executes them and replies right there, leaving everything recorded in the PR conversation. It's like having Terraform "embedded" in the change discussion.

How the Atlantis workflow works

The typical workflow is very natural and conversational:

1. Someone opens a Pull Request with changes in Terraform
        │
        ▼
2. Atlantis detects the PR and runs "plan" AUTOMATICALLY
   → posts the plan as a comment in the PR
        │
        ▼
3. The team REVIEWS the plan in the PR (subchap. 12.5)
        │
        ▼
4. A teammate APPROVES the PR
        │
        ▼
5. Someone comments "atlantis apply"
   → Atlantis applies the changes and posts the result
        │
        ▼
6. The PR is merged

Everything happens inside the Pull Request: the plan, the review, the approval, and the apply are all recorded in one place, like a conversation. It's total traceability and very easy to follow.

What Atlantis brings compared to a generic pipeline

You could do something similar with GitHub Actions (subchapter 22.1), so what advantages does Atlantis have?

  1. Designed specifically for Terraform

Atlantis "understands" Terraform: it manages plan and apply, state, locks, workspaces... natively. You don't have to build all that logic by hand in a generic pipeline.

  1. The plan, always visible in the PR

Atlantis automatically posts the plan as a comment, perfectly integrating it into the review. The "safety net" of reviewing the plan (subchapter 12.5) is built in by default.

  1. Control via comments

You decide when to apply, writing atlantis apply only when everything is reviewed and approved. It gives explicit and deliberate control over the deployment moment.

  1. Locking at the Pull Request level

Atlantis adds smart locking: if a PR is "working" on certain infrastructure, it blocks another PR from touching the same thing at the same time. This complements state locking (subchapter 20.2) by preventing conflicts between simultaneous changes, right from the review phase.

One consideration: you have to host it

An important practical difference: Atlantis is an application that you have to run and maintain yourself (usually on a server or container within your infrastructure). It's not a service you "just use" like GitHub Actions. This gives you more control and privacy (your code and credentials never leave your environment), but also means maintenance responsibility.

GitHub Actions:  managed by GitHub (you maintain nothing)
Atlantis:        you host and maintain it (more control, more responsibility)

When to use Atlantis?

Situation Recommendation
Starting out, small team A simple pipeline (GitHub Actions) is enough
Team wanting smooth GitOps for Terraform Atlantis fits very well
Many repos/teams using Terraform Atlantis centralizes and organizes the workflow
You don't want to maintain an extra tool Generic pipeline or Terraform Cloud (subchap. 22.3)

Tip: as with other tools (remember Kubernetes in Chapter 17, or Terragrunt in 19.3), don't adopt Atlantis just because it's popular. Start with a simple pipeline. If your team grows and the GitOps workflow with Terraform becomes central to your daily work, Atlantis adds a lot. Choose based on real need.

What you should remember

  • Atlantis is an open source tool that automates Terraform directly from Pull Requests, controlled via comments (atlantis plan, atlantis apply). Like an "assistant inside the PR."
  • The workflow is conversational and everything is recorded in the PR: Atlantis runs the plan automatically, the team reviews it, it's approved, and someone comments atlantis apply to deploy.
  • It brings advantages over a generic pipeline: designed for Terraform, the plan always visible in the PR, control via comments, and locking at the PR level.
  • Unlike GitHub Actions, you host and maintain Atlantis (more control and privacy, but more responsibility).
  • Don't adopt it because it's trendy: start simple and switch to Atlantis if GitOps with Terraform becomes central for your team.

In the next subchapter, we'll look at the "managed" option that avoids maintaining tools: Terraform Cloud / HCP Terraform, HashiCorp's own service.

Cloud, AWS & Terraform — From Zero to Expert

Chapter 1 · What is cloud computing

Chapter 2 · The cloud market and major providers

Chapter 3 · Regions, availability zones and edge

Chapter 4 · Compute: EC2

Chapter 5 · Storage: S3

Chapter 6 · Networking: VPC

Chapter 7 · Identity and access: IAM

Chapter 8 · Managed databases

Chapter 9 · Why Infrastructure as Code

Chapter 10 · HCL: the Terraform language

Chapter 11 · Providers and state

Chapter 12 · Your first real infrastructure in Terraform

Chapter 13 · Load balancing and auto scaling

Chapter 14 · Serverless with Lambda

Chapter 15 · Messaging and events

Chapter 16 · Content delivery and DNS

Chapter 17 · Containers on AWS

Chapter 18 · Modules: reuse and composition

Chapter 19 · Workspaces and environment management

Chapter 20 · Remote backends and locking

Chapter 21 · Infrastructure testing

Chapter 22 · Terraform in CI/CD

Chapter 23 · Defense in depth

Chapter 24 · Observability: logs, metrics and traces

Chapter 25 · Cost optimization

Chapter 26 · High availability and disaster recovery

Chapter 27 · AWS Well-Architected Framework

Chapter 28 · Serverless architectures at scale

Chapter 29 · Data platforms on AWS

Chapter 30 · Multi-account and landing zones

Chapter 31 · Platform Engineering and Internal Developer Platform

Chapter 32 · Relevant AWS certifications

Chapter 33 · Projects to consolidate what you've learned

Chapter 34 · Resources and community

© Copyright 2024. All rights reserved