Live data from Hacker News

Terraform 0.15 General Availability

hashicorp.com

101–110 of 239 posts

Re: Terraform 0.15 General Availability

#101
post #18

My tiny brain still don't get why people like terraform. Do people need to look at both terraform docs and aws/azure/gcp docs when writing a .tf file? The fact that terraform saves/remembers the resource states is like a double-edged sword: we cannot manually fix some minor mistakes of ours when creating resources because that'll mess up terraform

> we cannot manually fix some minor mistakes of ours when creating resources because that'll mess up terraform

I had an old boss who fixed minor mistakes in stored procedures on the live server and then wondered why they broke again when builds went out...

Re: Terraform 0.15 General Availability

#102
post #19

Earlier quoted context omitted.

> i had to pull the state and change the provider field manually to avoid recreation of some resources. Terraform CLI introduced an upgrade command (can't remember what it's called) that automatically does this for you.

In 0.14 that is no longer available.

Terraform 0.14 is pretty much fully compatible with 0.13, so no such command is necessary. All you have to do is make sure your state is for version 0.13. Outside that it's a bunch of usability changes that do not affect your tf code.

Re: Terraform 0.15 General Availability

#103

Earlier quoted context omitted.

> we cannot manually fix some minor mistakes of ours when creating resources because that'll mess up terraform In my opinion if you're doing manual fixes you're doing it wrong. Let's say you do your manual fix in your Dev environment. Do you remember to do it in Prod/whatever other environments you have? Are you sure you did the EXACT same thing? Did you change 5 other things trying to fix it first? You end up with s…

I think there's a middle ground if you're not sure how to fix a mistake in Terraform but you know how to do it in the console: * Make your changes by hand * Right afterward, run "terraform plan" to see how Terraform would undo your changes * Edit your Terraform config to reflect those changes, and run "terraform plan" again to make sure you caught everything. Repeat until it's a no-op. Now you've got a log of what yo…

You can do it that way, but I find the tf docs easier and more concise to use than clicking around the AWS UI.

Re: Terraform 0.15 General Availability

#104
post #95

I do not like terraform and I believe it's a terrible tool. Here is the error you get when it fails: Terraform does not automatically rollback in the face of errors. Instead, your Terraform state file has been partially updated with any resources that successfully completed. Please address the error above and apply again to incrementally change your infrastructure. If that error does not give you pause, I don't know…

> use whatever the cloud you are using has built it (cloudformation, deployment manager, etc). Not applicable if you're deploying infra across cloud (we do that across a dozen cloud providers!). Without terraform, it'll bring us tears. > Or about when it just loses tracks of resources. Never had this in years of using terraform. These should be qualified with how often they occur. > Terraform does not automatically r…

nah. i’ve heard the cross-cloud argument multiple times and it does not hold any water. i wish we lives in a world where we could do cloud agnostic stuff but the reality is that you have your aws terraform files, your gcp terraform files and so on.

Cloudformation? Like the tool that bring you from state A to state B or if it cannot rolls back to state A? Yeah. It’s an abomination for a tool to leave infra in a consistent state. Who would want that?

Re: checkout the code and apply again. What if I told you that terraform can mess up so hard that it won’t work? What if I told you that sometimes you will not be able to rollback OR even destroy your infra?

Here is an exercise for you. Create some infra with terraform and do a destroy and tell me if it managed to cleanup everything? I’m gonna bet you that for anything less than trivial you are gonna have a bad time. The solution? Tag shit and use a python script to cleanup. I’m not even kiddding.

Re: Terraform 0.15 General Availability

#105

Earlier quoted context omitted.

Roll back is one reason I choose AWS Cloudformation over Terraform. And also I do not see the reason for Terraform in my use case as we run only on AWS. No point in not using AWS native tools.

When using Terraform you should think of your IaC as the plans to build or rebuild your infrastructure, not an extension. I built mine in a way where I can destroy all the infrastructure in a plan and then reapply. You don't have to worry about rollbacks when you can just rebuild everything without affecting your end service.

welcome to the real world where you sometimes cannot do what you are saying :(

Re: Terraform 0.15 General Availability

#106
post #18

My tiny brain still don't get why people like terraform. Do people need to look at both terraform docs and aws/azure/gcp docs when writing a .tf file? The fact that terraform saves/remembers the resource states is like a double-edged sword: we cannot manually fix some minor mistakes of ours when creating resources because that'll mess up terraform

"I just spent a couple of hours standing up a specific resource, which was kind of a pain in the neck. Oh, now I need 23 more of them! That'll take another 30 seconds to generate the configuration and create the new resources." That's why I like Terraform. Edit: "Also, I created a thing 2 years ago and now I need another one. Oh, here it is in Terraform." It's incredibly nice not to have to re-learn how to make that…

> "Also, I created a thing 2 years ago and now I need another one."

Let me add, this thing was changed 2 years ago to add an option...why? Git blame to the rescue...

I probably use git history more in my tf code than in my regular programming.

Re: Terraform 0.15 General Availability

#107

Earlier quoted context omitted.

Cloudformation rollback is not exactly bulletproof either.

Especially initial deploys that rollback and you have to delete the stack to try to deploy again. Waste of time. On the whole terraform is much faster too.

here is a hint for you: you can tell cloudformation to nuke everything in case it fails.

Re: Terraform 0.15 General Availability

#108
post #94

I do not like terraform and I believe it's a terrible tool. Here is the error you get when it fails: Terraform does not automatically rollback in the face of errors. Instead, your Terraform state file has been partially updated with any resources that successfully completed. Please address the error above and apply again to incrementally change your infrastructure. If that error does not give you pause, I don't know…

I love your comment,"YOLO-ing" gave me a laugh, and a laugh at myself in some previously stressful/complex deployment periods. Terraform was not a friend there. That said, I've worked on/with a team enabling some fairly advanced & streamlined capabilities across all three clouds because of Terraform. The abstraction matters, and ability to model scaled platform components and architectures as singular units is import…

is the open source community great? Look at the open bugs. Some of them are old enough to go to school.

For extra lolz try killing the terraform process of pulling the network cable. Hilarity ensures and you’re gonna have a bad time recovering what it was doing.

I would not recommend Terraform period.

Re: Terraform 0.15 General Availability

#109

I do not like terraform and I believe it's a terrible tool. Here is the error you get when it fails: Terraform does not automatically rollback in the face of errors. Instead, your Terraform state file has been partially updated with any resources that successfully completed. Please address the error above and apply again to incrementally change your infrastructure. If that error does not give you pause, I don't know…

Roll back is one reason I choose AWS Cloudformation over Terraform. And also I do not see the reason for Terraform in my use case as we run only on AWS. No point in not using AWS native tools.

you dodged a bullet imho.

Re: Terraform 0.15 General Availability

#110
post #45
post #31

Earlier quoted context omitted.

Because the state exists regardless. When you write code that interfaces with AWS, there's always something that exists on the other side of the AWS API. The question you have is, how do you programmatically keep a copy of that state on your side of the API? The naive approach that tries to do this without state in code goes something like: a) invoke the remote API to look for something that should exist b) if it doe…

Maybe an unpopular opinion but what you just described as "naive" is arguably a better solution than Terraform's overengineering. I use Ansible to manage multiple clouds (Openstack, AWS...etc) using a mix of custom modules and public collections. I don't need a "state", I couldn't care less if resources exist or not, upgrades between versions are smooth, module/collection upgrades doesn't interfere with all the exist…

> upgrades between versions are smooth

I use tf and ansible regularly. I wouldn't call ansible upgrades exactly smooth, they deprecate features just like anyone else.

Post reply on HN