The plan/apply PR workflow

Comment-driven plan and apply.

Advanced12 min · lesson 3 of 12

The day-to-day workflow is comment-driven. When a PR changes Terraform, Atlantis autoplans and posts the plan as a comment, including the familiar +/~/-/+- summary. You iterate: push a fix, Atlantis re-plans and updates the comment. When the plan is right and the PR is approved, a reviewer comments atlantis apply, Atlantis runs the apply and posts the result, and (in the common setup) the PR is then merged. You can also comment atlantis plan to re-run manually.

PR comments
# Atlantis auto-posts on PR open:
Ran Plan for dir: `live/prod/vpc`
+ aws_vpc.main will be created
Plan: 1 to add, 0 to change, 0 to destroy.
To apply, comment: `atlantis apply`
# a reviewer, after approval, comments:
atlantis apply -d live/prod/vpc

Apply before or after merge

Atlantis supports two philosophies. The default is apply-before-merge: you apply from the PR while it is open, confirm the infrastructure changed cleanly, then merge — so main always reflects applied reality. The alternative is apply-after-merge (via the merge workflow), closer to app GitOps. Apply-before-merge is the common Terraform choice because it lets you catch an apply failure before the change is recorded as merged. Pick one and be consistent.

Read the plan in the comment before applying
The plan Atlantis posts is the same Terraform plan you must actually read — a -/+ (destroy and recreate) on a database or a surprise deletion is right there in the comment, and atlantis apply will execute it. The convenience of applying with a comment makes it easy to rubber-stamp; treat the posted plan with the same scrutiny as any apply, because that is exactly what it is.