Skip to content

Instantly share code, notes, and snippets.

@HariSekhon
Created July 17, 2024 09:16
Show Gist options
  • Save HariSekhon/647f24a4d6669b040cf60f166740cb04 to your computer and use it in GitHub Desktop.
Save HariSekhon/647f24a4d6669b040cf60f166740cb04 to your computer and use it in GitHub Desktop.
atlantis.md from HariSekhon/Knowledge-Base repo: https://github.com/HariSekhon/Knowledge-Base

Atlantis

https://www.runatlantis.io/

Terraform pull request automation on GitHub using GitHub Actions.

  • interaction is through pull request comments
  • Atlantis comments on the PR with command prompts of what to type in comments (and even corrects you if you comment terraform instead of atlantis command)
  • runs the Terraform / Terragrunt plan automatically upon creation / commit changes to the PR including GitHub update from trunk
  • prints the plan output in PR comment
  • comment atlantis apply to respond for Atlantis to apply the changes
  • requires PR to be mergeable before it will honor atlantis apply comments
    • so your other PR checks must pass first
  • Terragrunt becomes more useful in this context to modularize code base to reduce blast radius of changes and have Atlantis do shorter plan and apply runs
atlantis plan # -d path/to/terragrunt/module/directory
atlantis apply

Do Not Merge Pull Requests Early

If you merge a pull request, Atlantis will refuse to operate apply it.

You will then need to revert the PR and raise it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment