Simple Atlantis Terraform Configuration - Atlantis-terraform Typing CST Test
Loading…
Simple Atlantis Terraform Configuration — Atlantis-terraform Code
A simple Atlantis configuration to automate Terraform workflows for a project repository.
# atlantis/demo/repos.yaml
repos:
- id: github.com/example/terraform-project
workflow: default
apply_requirements: [approved]
allowed_overrides: [workflow]
workflows:
default:
plan:
steps:
- init
- plan
apply:
steps:
- applyAtlantis-terraform Language Guide
Atlantis is an open-source tool that automates Terraform pull request workflows by running `terraform plan` and `terraform apply` commands in response to Git events, enabling safe and auditable infrastructure changes.
Primary Use Cases
- ▸Automated Terraform plan and apply on pull requests
- ▸Enforcing GitOps workflow for Terraform infrastructure
- ▸Preventing direct, unreviewed Terraform changes
- ▸Multi-team collaboration on shared Terraform modules
- ▸Integration with CI/CD pipelines for infrastructure automation
Notable Features
- ▸Pull request automation for `terraform plan` and `terraform apply`
- ▸Integration with GitHub, GitLab, Bitbucket, and Azure DevOps
- ▸Support for multiple Terraform projects and workspaces
- ▸Automatic drift detection and plan enforcement
- ▸Audit logs and comment history for compliance
Origin & Creator
Created by runatlantis/Atlantis in 2017 to standardize GitOps-style Terraform workflows.
Industrial Note
Widely used in cloud-native environments, enterprise DevOps, and multi-cloud infrastructure automation where Terraform is the main IaC tool.
Quick Explain
- ▸Atlantis integrates Terraform with Git workflow for automated CI/CD.
- ▸Runs `terraform plan` on pull requests and `terraform apply` on merge.
- ▸Prevents unsafe Terraform operations on production infrastructure.
- ▸Tracks changes and provides comments directly in pull requests.
- ▸Supports multi-repository, multi-workspace, and multi-project configurations.
Core Features
- ▸Atlantis server - central controller that listens to Git webhooks
- ▸Atlantis webhook - triggers plan/apply events
- ▸Terraform plan automation - preview infrastructure changes
- ▸Terraform apply automation - apply approved changes
- ▸GitHub/GitLab/Bitbucket integration - PR comments and approvals
Learning Path
- ▸Learn Git-based collaboration
- ▸Understand Terraform basics and state management
- ▸Learn Atlantis PR-driven workflow
- ▸Write atlantis.yaml configurations
- ▸Integrate with Terraform modules and remote backends
Practical Examples
- ▸Automated `terraform plan` on a feature branch PR
- ▸`terraform apply` after PR approval
- ▸Multi-module Terraform project with Atlantis automation
- ▸Detecting drift and notifying teams via PR comments
- ▸Integrating Atlantis with Slack notifications for PR updates
Comparisons
- ▸Atlantis vs Terraform Cloud: GitOps PR automation vs SaaS Terraform management
- ▸Atlantis vs Jenkins: PR-level Terraform workflow vs general CI/CD
- ▸Atlantis vs GitHub Actions: Git-native automation vs workflow runner
- ▸Atlantis vs Spacelift: Open-source vs enterprise SaaS automation
- ▸Atlantis vs Terraform Enterprise: PR automation vs managed Terraform lifecycle
Strengths
- ▸Enforces review-based Terraform workflow
- ▸Prevents accidental changes to infrastructure
- ▸Supports enterprise multi-repo and multi-project setups
- ▸Integrates seamlessly into GitOps CI/CD pipelines
- ▸Provides audit trails for Terraform operations
Limitations
- ▸Requires hosting and maintaining an Atlantis server
- ▸Limited UI - mostly CLI and pull request comments
- ▸Complex setup for large-scale multi-repo environments
- ▸Does not replace Terraform state management
- ▸Requires network access from Atlantis server to Terraform backend
When NOT to Use
- ▸Projects without Terraform
- ▸Single-user environments without PR workflows
- ▸Teams not using Git-based collaboration
- ▸Infrastructure without Terraform state management
- ▸Projects preferring SaaS Terraform solutions
Cheat Sheet
- ▸atlantis plan
- ▸atlantis apply
- ▸atlantis unlock
- ▸atlantis server
- ▸atlantis help
FAQ
- ▸Can Atlantis run without Git? -> No, it depends on PR workflow.
- ▸Is Atlantis free? -> Yes, open-source under Apache 2.0.
- ▸Can Atlantis manage multiple Terraform workspaces? -> Yes, via project config.
- ▸Does Atlantis replace Terraform state? -> No, it integrates with existing backends.
- ▸Can Atlantis run outside Kubernetes? -> Yes, as Docker container or binary.
30-Day Skill Plan
- ▸Week 1: Run local Atlantis and simple plan
- ▸Week 2: Configure atlantis.yaml for one repo
- ▸Week 3: Multi-project and workspace configuration
- ▸Week 4: Integrate notifications and approvals
- ▸Week 5: Deploy Atlantis on Kubernetes with HA setup
Final Summary
- ▸Atlantis automates Terraform PR workflows with `plan` and `apply`.
- ▸Integrates Git collaboration into infrastructure automation.
- ▸Enforces safe, auditable changes with review-based approvals.
- ▸Supports multi-project, multi-repo, and multi-workspace setups.
- ▸Ideal for GitOps-style Terraform automation in enterprise and cloud-native environments.
Project Structure
- ▸Terraform code directory
- ▸atlantis.yaml - project configuration
- ▸Backend configuration for state storage
- ▸Git repository for code versioning
- ▸Optional modules and shared libraries
Basic Concepts
- ▸Project - a Terraform codebase or module in a repo
- ▸Workspace - Terraform workspace for a project
- ▸Plan - preview of Terraform changes
- ▸Apply - execution of approved Terraform changes
- ▸Locking - prevents concurrent `apply` runs
Official Docs
- ▸https://www.runatlantis.io/docs/
- ▸Atlantis GitHub Repository
- ▸atlantis.yaml Configuration Reference
- ▸Terraform Backend Integration
- ▸CI/CD and PR Automation with Atlantis