Intro
I’ve been finding myself editing automation code for tools like Terraform (A platform agnostic infrastructure provisioning tool) more frequently in the past few months.
No longer satisfied with using vim (Sorry fans!) I decided to make the switch to Atom.
So far things have been going smoothly but I knew the tool could help me write better Terraform code with a few more tweaks (or more importantly, plugins).
The Plugins
The following plugins helped provide me with basic completion, syntax highlighting, linting, and automatic formatting for all my Terraform .tf files.
atom-beautify
linter
linter-terraform-syntax
language-terraform
Instead of writing a lengthy article on about how totally awesome all this is, I’ve decided to help you get started as quickly as possible.
Get Started Quickly
Assuming you already have terraform
in your PATH, the following code is install and forget (minus one change I’ll mention after the code snippet).
Just copy and paste into your terminal of choice.
apm install atom-beautify linter linter-terraform-syntax language-terraform
A Small Note
If you’d like terraform fmt
to occur on each save, you’ll need to make a small change to atom-beautify.
- Go to the packages menu (Edit>Preferences>Packages)
- Click the “Settings” tab on atom-beautify
- Find and click Terraform to expand it (List is in alphabetical order)
- Make sure the “Beautify On Save” checkbox is ticked.
- ???
- PROFIT!
In Closing
While this article is rather short, it should help you quickly setup Atom for easily editing Terraform .tf files.
If you have any questions, feel free to comment below.
Happy automating!