Referring to resources named with variables in Terraform

I was fundamentally misunderstanding how modules worked. Terraform does not support interpolation in resource names (see the relevant issues), but that doesn’t matter in my case, because the resources of each instance of a module are in the instance’s namespace. I was worried about resource names colliding, but the module system already handles that.

How to apply SQL Scripts on RDS with Terraform

Like this solution, You can also avoid instance setup time/cost by using your own machine with local-exec IF your RDS database is publicly available and you have setup ingress to allow your machine to connect. Then, with credentials stored securely in your environment, you would just do something like: resource “null_resource” “db_setup” { # runs … Read more