Terraform Gotchas and How We Work Around Them
heap.engineering
Terraform Gotchas and How We Work Around Them
1–10 of 82 posts
Re: Terraform Gotchas and How We Work Around Them
#2Re: Terraform Gotchas and How We Work Around Them
#3Hey author here! Happy to answer any questions etc :-)
Re: Terraform Gotchas and How We Work Around Them
#4Hey author here! Happy to answer any questions etc :-)
Don't have the apply be automatic after a review is approved; terraform apply's occasionally go sideways and need human intervention (remember: rollbacks are not automatic). A human should always kick off the apply and monitor state change activity.
Re: Terraform Gotchas and How We Work Around Them
#5Hey author here! Happy to answer any questions etc :-)
I've run into another similar type issue now and I think that I'm going to have to do state surgery like you. I want to refactor some of my terraform resources into modules, but this changes the resource names. I can't see any way to do it without either standing up new infrastructure or modifying the state directly.
Re: Terraform Gotchas and How We Work Around Them
#6::Sulks off dejectedly::
Re: Terraform Gotchas and How We Work Around Them
#7So... ahem what other idiots came here expecting a post about troubleshooting Martian habitability? ::Sulks off dejectedly::
Re: Terraform Gotchas and How We Work Around Them
#8Hey author here! Happy to answer any questions etc :-)
No questions, just a suggestion: implement the part where the terraform plan is added as a comment in the PR. We set this up at my current employer and it makes the review process much quicker (also, commenting on lines in the ~plan~ terraform code changes is the bee's knees). Don't have the apply be automatic after a review is approved; terraform apply's occasionally go sideways and need human intervention (remember…
Re: Terraform Gotchas and How We Work Around Them
#9Hey author here! Happy to answer any questions etc :-)
No questions, just a suggestion: implement the part where the terraform plan is added as a comment in the PR. We set this up at my current employer and it makes the review process much quicker (also, commenting on lines in the ~plan~ terraform code changes is the bee's knees). Don't have the apply be automatic after a review is approved; terraform apply's occasionally go sideways and need human intervention (remember…
And thanks for the suggestion. So far it's been on a someday maybe list, but if it really does help that much, maybe we'll bump it to someday maybe soon.
Re: Terraform Gotchas and How We Work Around Them
#10Hey author here! Happy to answer any questions etc :-)
Great post! I too had the issue with AWS volume attachments and the need to separate them out. Luckily it happened early during some of my first provisioning and we realized it before standing up more databases. I now have a policy where each server has a separate EBS volume, using a volume attachment Terraform resource, for any data. Inline EBS volumes are just used for the OS. I've run into another similar type iss…
https://github.com/sevagh/goat
This way in Terraform I provision a group of volumes, a group of instances, and rely on `goat` to do the rest.