Terraform - The Basics

Terraform is DevOps for the lazy, and I think I'm in love.

What I've learned the most about DevOps and CI/CD (Continuous Integration/Continuous Delivery) is that the goal of any DevOps system is to use it as little as possible and to make it as low-touch as possible.

For previous projects, I developed GitHub Actions, or automations that run in the cloud on GitHub repos, to scan, build and deploy an AWS Lambda (a serverless function) automatically. All I had to do was merge to the main branch and bam, the code would deploy. The goal was for me to not have to deal with deployments, as much as humanly possible, because CI/CD and DevOps are a pain in the ass.

Terraform seems to be a tool in the same vein. It is an Infrastructure as Code (IaC) framework that interacts with multiple cloud environments to do CRUD (Create, Read, Update, Delete) operations on cloud infrastructure. Anyone who has dealt with the AWS console or CLI knows why this is an attractive idea. The console is an unweildy pain in the ass and the CLI is a clunky pain in the ass. Terraform offers an alternative to these two options by giving a user the ability to declare how they want the infrastructure to look in the form of Terraform or JSON syntax code and use providers, essentially environment-specific libraries, to make the infrastructure so.

This is called declarative syntax: I declare what I want the infrastructure to look like and Terraform makes it happen. This is incredibly nice because you don't have to know how to make the infrastructure change in the ways it needs to change and how to make the individual pieces interact with each other the way you want them to, you just need to know what pieces you need and what they need to look like.

I'm very much a Terraform noob, but I'm learning it because I keep needing to deploy new Lambda functions with essentially the same exact roles, function names, accesses, etc. and I keep having to set them up manually, so I'm letting this blog be my notepad in learning Terraform over time.