Hacker News new | ask | show | jobs
by breendreams 589 days ago
For Terraform, most of the issues with conditionals can be resolved by creating dictionaries dynamically and looping through it to generate resources.

You get the bonus of controlling the resource id and being able to selectively delete resources without worrying about ordering.

1 comments

This massively depends on your provider code. Using loops to manage tf stuff can you you into really “fun” scenarios when you want to e.g delete an openstack firewall rule from the middle of the array.

I’ve been burned so many times here that I hate all of this stuff with an extreme passion.

Crossplane seems to be a genuinely better way out but there are big gotchas there also like resources that can simply never be deleted