Hacker News new | ask | show | jobs
by Pet_Ant 388 days ago
Just started learning Terraform. What would you recommend other than doing it byhand or provider dependent tooling?
2 comments

Terraform is hard because it can be a different way of thinking about deployments and your infrastructure. And since it's declarative you can't do conditionals in normal ways.

What I used to do is create things in my target environment then try to recreate them in terraform (without the import, because import didn't really work so well). Then do an apply/plan and see what changes were listed.

What I would do today is ask ChatGPT for terraform for specific things, then see what it outputs, compare it with the registry, then do the apply.

Terraform is half the battle, the other half is figuring out how the specific provider represents their stuff...which is why ChatGPT is helpful.

Oh, and also look at your provider's examples. You presumably know how things work in your provider, so looking at their terraform registry will help you figure out how they model stuff in terraform so you can model your stuff in terraform.

Or use Pulumi instead and get the best if both worlds.
The only thing worse than Terraform is not using Terraform. It's a pain but always worth using.