Live data from Hacker News

Terraform 1.0

github.com

71–80 of 315 posts

Re: Terraform 1.0

#71

You people hating on Terraform are spoiled. My company insists on using CloudFormation, which I hate with a passion.

CloudFormation is too limited. I imagine most companies use much more than AWS. Off the top of my head, we use Cloudflare, PagerDuty, GitLab, etc all of which have Terraform providers.

What happens when you have to use something outside of AWS? How do you codify those changes?

Re: Terraform 1.0

#72
post #67

Earlier quoted context omitted.

How does terraform compare to ansible?

They're not competition. I use Terraform for infra provisioning, and Ansible for post-provisioning application setup. I also use Packer + Ansible playbooks to build my AMIs.

Yup, that's the best use-case. The more that cloudy / container stuff takes over the less I use Ansible tbf.

Re: Terraform 1.0

#73

Earlier quoted context omitted.

I strongly agree both with respect for the half-baked-ness of the language and with the "it's probably the best out there". Ultimately, these tools should have a static/yaml-like "assembly language" that describes the state of your infrastructure without any of the DRY. There would be a diffing engine which would figure out what changes need to be applied and apply them accordingly. Users could use some vanilla progr…

> these tools should have a static/yaml-like "assembly language" that describes the state of your infrastructure without any of the DRY the last five words are a bit of a double negative; i think you mean "without the repetition" but I can't tell.

"without DRY" in this case means "with repetitions" i.e. in a verbose way. GP wants to be able to generate this verbose, machine readable syntax with DRY, human readable syntax.

Re: Terraform 1.0

#74
post #37

Serious question. What value does Terraform provide? Two years ago I looked into it and rather then having an abstraction from cloud providers it seemed to require to still target (and code against) each one specifically. So, I was quite disappointed as I thought the value proposition was to not have to know x cloud provider specific terminologies. Any insights much appreciated. Edit: I was a little worried asking su…

It's better than CloudFormation (or a bunch of home grown bash scripts) and you can also modify providers beyond just the cloud host (ie: datadog alerts, database users and permissions, etc, etc.).

Just to expand on your second point, because I think it's often missed, there are a ton of 'providers' available that extend management of their products (to varying, sometimes hilariously little extent). If you're running products from any of the vendors on this list, you might be able to use terraform to manage them as well:

https://registry.terraform.io/browse/providers

Re: Terraform 1.0

#75

Earlier quoted context omitted.

I strongly agree both with respect for the half-baked-ness of the language and with the "it's probably the best out there". Ultimately, these tools should have a static/yaml-like "assembly language" that describes the state of your infrastructure without any of the DRY. There would be a diffing engine which would figure out what changes need to be applied and apply them accordingly. Users could use some vanilla progr…

100%. Terraform is half-way between a tool for generating the configuration and applying it. I think Terraform's application engine is actually quite good, but I would like to use a much better tool to generate the config. (And be able to diff that config) You can feed JSON to Terraform however this falls over if you need dependencies for output values. This usually isn't an issue because most Cloud provider resource…

There's CDK for Terraform: https://github.com/hashicorp/terraform-cdk

Re: Terraform 1.0

#76
post #9

I hate Terraform with a passion but it is probably the best tool out there for managing cloud infrastructure so I use it at work with no plans to replace it. The biggest downsides are the awful half-baked language and the awkwardness of modules and passing values throughout your config. Also the staticness of providers are a serious pain, for example you can't create a kubernetes cluster then add a resource to it. Th…

The tool is ok, but developing plugins for it shows how inadequate Golang is for the job. There's so much repetition and boilerplate required. I wrote a FreeIPA plugin a few years back, it handled just registering a host and the executable weighed over 100 MB! WTF? Haven't looked at that side of things lately, I wonder if it's different nowadays.

We have a big amount of resources available inside of our Spacelift provider[0] and it weights ~20 MB.

It'll probably mostly depend on the libraries you use.

[0]:https://github.com/spacelift-io/terraform-provider-spacelift...

Re: Terraform 1.0

#77
post #9

I hate Terraform with a passion but it is probably the best tool out there for managing cloud infrastructure so I use it at work with no plans to replace it. The biggest downsides are the awful half-baked language and the awkwardness of modules and passing values throughout your config. Also the staticness of providers are a serious pain, for example you can't create a kubernetes cluster then add a resource to it. Th…

+1 from me on the "awful half-baked language" (HCL).

I just recently wrote an article about my experience, including issues and workarounds, when migrating from Terraform to Pulumi: https://blog.ekik.org/my-experience-migrating-my-infrastruct...

Hope it's OK that I'm sharing it here. I think it's relevant because there seems to be quite a lot of interest around Pulumi, and how one would go about moving from Terraform to Pulumi.

Re: Terraform 1.0

#78
post #6

Just be careful with your state file when upgrading!

I've gotten into the habit of manually creating a backup of the state file:

# to view the state file

$ aws s3 cp --quiet s3://terraform/production/terraform.tfstate /dev/stdout

# to backup the state file

$ aws s3 cp --quiet s3://terraform/production/terraform.tfstate > terraform.tfstate.bak

Re: Terraform 1.0

#79

You people hating on Terraform are spoiled. My company insists on using CloudFormation, which I hate with a passion.

> My company insists on using CloudFormation, which I hate with a passion

I turned down offers when I saw they use Terraform. I was lucky to find purely CloudFormation based infra development.

Re: Terraform 1.0

#80
post #63

Earlier quoted context omitted.

I strongly agree both with respect for the half-baked-ness of the language and with the "it's probably the best out there". Ultimately, these tools should have a static/yaml-like "assembly language" that describes the state of your infrastructure without any of the DRY. There would be a diffing engine which would figure out what changes need to be applied and apply them accordingly. Users could use some vanilla progr…

> Ultimately, these tools should have a static/yaml-like "assembly language" that describes the state of your infrastructure without any of the DRY. CloudFormation ? > There would be a diffing engine which would figure out what changes need to be applied and apply them accordingly. CloudFormation.

Yeah, CloudFormation is workable in this regard (I've created a neat generator for Python), although it has lots of its own problems (e.g., if you want to create a new resource, you have to run it as its own lambda--your infra-as-code needs its own infra which needs its own infra-as-code).
Post reply on HN