News for hackers. Stuff that matters.
Re:Terraform 0.15 General Availability by manishsharan on Wednesday April 14, 2021 @09:01PM (#26815054)
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.
Re:Terraform 0.15 General Availability by encryptluks2 on Wednesday April 14, 2021 @09:13PM (#26815110)
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.
Re:Terraform 0.15 General Availability by rantwasp on Wednesday April 14, 2021 @09:37PM (#26815257)
welcome to the real world where you sometimes cannot do what you are saying :(
Re:Terraform 0.15 General Availability by takeda on Thursday April 15, 2021 @03:09AM (#26817041)
What parent meant is that in CF if it encounters an error, by default will roll back to state before the update. TF will just leave it broken.
Re:Terraform 0.15 General Availability by encryptluks2 on Thursday April 15, 2021 @07:57AM (#26819304)
It isn't left broken per say, in fact you should be able to version the state and rollback to the previous state and have it remove whatever new resources were created when you re-apply.

I just take another approach which is if something doesn't work, then I'm able to quickly blow it away and re-deploy without affecting the end service by having the apply only target specific environments.

Re:Terraform 0.15 General Availability by takeda on Friday April 16, 2021 @04:32PM (#26838764)
If it is half deployed it is broken, maybe in some cases service continues running, but in other will be broken.

The solution you mentioned relies on other tools and some manual work you need to do. Also with how TF works by default you might never be able to restore to exact same state as it was before.

CF when needs to replace a resource it first creates a new copy, and applies all changes if everything succeeds then it removes old resource, if it fails it rolls changes back.

You have an option that allows you to do that with a resource, but it's done individually per resource and it still isn't exactly the same thing.

Re:Terraform 0.15 General Availability by matwood on Thursday April 15, 2021 @06:22AM (#26818572)
I don't use CF, but how does it handle rolling back a delete (thus recreating a resource) and resource ARNs? Is it using some functionality not available to other tools?

I always found tf's lack of rollback ability, basically admitting there is no way to really rollback to the exact state, ARNs and all, so it isn't going to try.

Re:Terraform 0.15 General Availability by myroon5 on Thursday April 15, 2021 @05:24PM (#26826288)
>Is it using some functionality not available to other tools?

No, CloudFormation just postpones resource deletions towards the end of stack operations to allow successful operation rollbacks. Even the default replacement strategy is creating the new resource before deleting the old resource whenever possible for this reason:

https://github.com/aws-cloudformation/aws-cloudformation-res...

Re:Terraform 0.15 General Availability by mwarkentin on Wednesday April 14, 2021 @09:22PM (#26815169)
Cloudformation rollback is not exactly bulletproof either.
Re:Terraform 0.15 General Availability by leetrout on Wednesday April 14, 2021 @09:29PM (#26815207)
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.

Re:Terraform 0.15 General Availability by takeda on Thursday April 15, 2021 @03:18AM (#26817105)
CF gives you both behaviors, you have option to select which one you prefer.
Re:Terraform 0.15 General Availability by leetrout on Thursday April 15, 2021 @07:02AM (#26818878)
Re:Terraform 0.15 General Availability by takeda on Friday April 16, 2021 @04:28PM (#26838709)
I don't use it, so don't know if it is a missing feature then request it.

We are talking here about CF and CF gives you control over it.

Re:Terraform 0.15 General Availability by rantwasp on Wednesday April 14, 2021 @09:38PM (#26815266)
here is a hint for you: you can tell cloudformation to nuke everything in case it fails.
Re:Terraform 0.15 General Availability by leetrout on Thursday April 15, 2021 @07:02AM (#26818877)
Re:Terraform 0.15 General Availability by rantwasp on Thursday April 15, 2021 @10:59AM (#26821275)
sam uses cloudformation under the hood. so you can invoke cloudformation directly or demand this is added here: https://github.com/aws/aws-sam-cli/issues/2191
Re:Terraform 0.15 General Availability by rantwasp on Wednesday April 14, 2021 @09:41PM (#26815293)
you dodged a bullet imho.