Is there a templated secret_value resource, that allows default inputs?
I am looking for something like
resource "random_password" "db_password" {
length = 64
special = false
}
resource "secret_value" "connection_string" {
value = "postgresql://postgres:${random_password.db_password.result}@service-url:5432/postgres"
}
So it will generate a default secret string when I apply changes.
But also supports imports e.g.:
terraform import secret_value.connection_string "postgresql://...."
There is one that I found, but it does not seem to support default templates.
The reason is that in staging environments, by workloads connect to a postgres deployed in the cluster, where as for the production environment we’re using DB from RDS. Therefore I’d like to be able to import custom value for prod, but leave it as it is for other environments.