I've been tasked to learn how to manage our security tooling (at work) using Terraform.
I'm in the process of completing a introductory course at Pluralsight, but the course is rather dry. I'm maybe a 3rd of the way through the course and I was super aloof, so I decided to view some Youtube videos and work through a tutorial instead.
A few weeks ago, I'd used Terraform to deploy a small Docker container that had a running SSH server, but that was simple and I needed a bit more than that.
Now, I've been using Docker containers a couple of years now, at home in my home lab. I started out with one dev container stack that resided on the LAN and once I was comfortable with Docker, I replaced my public Wordpress site (non-containerized) with a Docker instance.
Today, I wanted to see if I could transcribe my Docker compose file to Terraform code. I did cheat - I used Siri AI to assist because I wanted to move quickly. I didn't want this to take days. It took me a couple of hours but I now have a working Docker stack that was deployed with Terraform!
And I initially didn't understand if the code would generate the containers but still leverage Docker to start the containers, or if Terraform did it all. I soon found that when you run "terraform apply", it starts the containers (and restarts if the containers are already running).
I'm still wondering why I should use Terraform instead of Docker (I strictly use compose.yml files when using Docker). Yes, I've to use Terraform at work but I don't find it much different than using Docker. I'm not sure which is more efficient, code-wise.
I even got a taste of updating my main.tf to update Wordpress from 7.1.3 to 7.1.5 (update was released today).
I also created a new Git repo just for my new Terraform work space, pushing the Terraform code to the new Git repo.
This is all new to me. I'm trying to make up for the last 5-6 years of being misused at work - I'm not where I need to be, professionally. I've never had the time to learn to use Git or Docker or Terraform or Anisible. Most of my experience before my current job was as a security analyst. Analysts (where I've worked, at least) don't typically use those tools.
I've a bunch of other Docker stacks that I can rebuild using Terraform. I'll slowly work my way through them all, using AI only when I get stuck (and when I've questions about new things).
I'm not gonna lie...while it was a tad bit frustrating, it was fun!