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.
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.
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.
How to use
- 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/*'
- Add an
atlantis.yamlto your Terraform repository:
version: 3
projects:
- name: production
dir: environments/production
workflow: default
autoplan:
when_modified: ['*.tf', '*.tfvars']
enabled: true
- Open a PR modifying Terraform files. Atlantis posts the plan automatically. Comment
atlantis applyto execute.
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.
Related on TokRepo
- AI tools for DevOps -- Infrastructure automation and CI/CD tools
- AI tools for automation -- Workflow automation for development teams
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
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.
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.
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.
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.
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)
- Atlantis GitHub— Atlantis automates Terraform plan and apply via pull requests
- Atlantis Documentation— PR-based Terraform workflow with workspace locking
- HashiCorp Terraform Docs— Terraform remote state backend best practices
Related on TokRepo
Discussion
Related Assets
Conda — Cross-Platform Package and Environment Manager
Install, update, and manage packages and isolated environments for Python, R, C/C++, and hundreds of other languages from a single tool.
Sphinx — Python Documentation Generator
Generate professional documentation from reStructuredText and Markdown with cross-references, API autodoc, and multiple output formats.
Neutralinojs — Lightweight Cross-Platform Desktop Apps
Build desktop applications with HTML, CSS, and JavaScript using a tiny native runtime instead of bundling Chromium.