ConfigsApr 15, 2026·3 min read

Atlantis — Terraform Pull Request Automation for Teams

Turn `terraform plan` and `apply` into GitHub/GitLab pull-request comments with locking, policy checks, and full audit history.

TL;DR
Atlantis turns terraform plan and apply into pull request comments with locking, policy checks, and audit history.
§01

What it is

Atlantis is a self-hosted application that automates Terraform workflows through pull requests. When you open a PR that modifies Terraform code, Atlantis automatically runs terraform plan and posts the output as a PR comment. Team members review the plan, and when approved, comment atlantis apply to execute the changes.

Atlantis targets infrastructure teams that want peer review for Terraform changes. It enforces a workflow where no infrastructure change happens without a plan being reviewed in a pull request.

§02

How it saves time or tokens

Atlantis eliminates the manual cycle of running terraform plan locally, pasting output into a PR, and then running terraform apply from a local machine. It also prevents the 'who ran apply last' problem by locking workspaces to specific PRs.

The audit trail is automatic. Every plan and apply is recorded in the PR history, making compliance and post-incident analysis straightforward.

§03

How to use

  1. Deploy the Atlantis server:
atlantis server \
  --atlantis-url='https://atlantis.example.com' \
  --gh-user='atlantis-bot' \
  --gh-token='ghp_xxx' \
  --repo-allowlist='github.com/myorg/*'
  1. Add an atlantis.yaml to your Terraform repository:
version: 3
projects:
  - name: production
    dir: environments/production
    workflow: default
    autoplan:
      when_modified: ['*.tf', '*.tfvars']
      enabled: true
  1. Open a PR modifying Terraform files. Atlantis posts the plan automatically. Comment atlantis apply to execute.
§04

Example

Atlantis workflow with custom plan and apply steps:

version: 3
workflows:
  custom:
    plan:
      steps:
        - run: terraform fmt -check
        - init
        - plan
    apply:
      steps:
        - run: echo 'Applying to production'
        - apply
projects:
  - name: prod
    dir: environments/prod
    workflow: custom

Custom steps let you add linting, cost estimation (infracost), or policy checks (OPA/Conftest) before plan or apply.

§05

Related on TokRepo

§06

Common pitfalls

  • Not configuring workspace locking. Without locking, two PRs modifying the same Terraform state can conflict. Atlantis locks workspaces by default, but verify the behavior in your configuration.
  • Running Atlantis without HTTPS. Atlantis receives webhook payloads from GitHub/GitLab. Without HTTPS and webhook secrets, attackers could trigger arbitrary Terraform commands.
  • Storing Terraform state in the Atlantis server. Atlantis does not manage state. Use a remote backend (S3, GCS, Terraform Cloud) for state storage.

Frequently Asked Questions

Does Atlantis support both GitHub and GitLab?+

Yes. Atlantis supports GitHub, GitLab, Bitbucket Server, Bitbucket Cloud, and Azure DevOps. Configuration varies by provider, but the core workflow (plan on PR, apply on comment) is the same.

How does Atlantis handle multiple Terraform environments?+

Atlantis supports multiple projects within a single repository. Each project has its own directory, workspace, and workflow. You can define separate configurations for development, staging, and production in atlantis.yaml.

Can Atlantis enforce policy checks before applying?+

Yes. Atlantis supports custom workflow steps where you can run OPA/Conftest policy checks, Sentinel policies, or any script before plan or apply. Failed checks prevent the apply from proceeding.

Is Atlantis free and open source?+

Yes. Atlantis is open source under the Apache-2.0 license. There is no paid version. The project is community-maintained with contributions from companies like Hootsuite, Lyft, and others.

How does Atlantis compare to Terraform Cloud?+

Terraform Cloud is a managed SaaS by HashiCorp with features like private module registry, Sentinel policies, and team management. Atlantis is self-hosted and focuses specifically on the PR-based plan/apply workflow. Atlantis is free; Terraform Cloud has paid tiers.

Citations (3)

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets