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.