My Experience and Thoughts on Atlantis

atlantis

Note: This post was originally posted on my personal blog. I have copied the content to this blog.

I started using Atlantis at the behest of a friend who urged me to use it instead of GitHub actions for managing Terraform repositories.

Configuring it was slightly more involved than I expected, partly because I configured Atlantis via Terraform which I had never done before but also because I needed to provide Newrelic and PagerDuty environment variables.

Essentially, you install Atlantis, connect it to GitHub, then restart Atlantis with the private key and GitHub token the integration gave you and it will watch all repos by default to try to build Terraform on.

I’ve found it pretty useful, like when I needed to do some Terraform development on a computer that I didn’t have a fully configured local Terraform environment.

The workflow is you make your changes in a new branch, PR it to master and Atlantis will automatically do a terraform plan (atlantis plan). If that is successful, you can comment atlantis apply and it will apply that branch to your environment. Then if all is well, you merge the code. I think that’s a little backwards since you should only be applying tested code from master but for my local, single person development it works great.

One nice thing is Atlantis will lock the Terraform state while there’s an open PR so it doesn’t get mangled.

Overall I think I could use Atlantis 90-95% of the time, however I sometimes still need to drop into a Terraform workspace to adjust state or import resources. I don’t think that’s a fault of Atlantis, more of a commentary on working with Terraform itself.

With that said, often I will skip Atlantis simply because it’s faster to apply locally and commit up afterwards, but again this is kind of a function of me being the only person I have to worry about. If I was on a team I would urge Atlantis to be used as often as possible.

atlantis