diff --git a/templates/common/infra/terraform/core/database/postgresql/postgresql.tf b/templates/common/infra/terraform/core/database/postgresql/postgresql.tf index ccf82178a80..1acabb7876c 100644 --- a/templates/common/infra/terraform/core/database/postgresql/postgresql.tf +++ b/templates/common/infra/terraform/core/database/postgresql/postgresql.tf @@ -92,7 +92,7 @@ resource "azurerm_resource_deployment_script_azure_cli" "psql-script" { } environment_variable { name = "DBSERVER" - value = azurerm_postgresql_flexible_server.psql_server.name + value = azurerm_postgresql_flexible_server.psql_server.fqdn } script_content = <<-EOT @@ -104,7 +104,7 @@ resource "azurerm_resource_deployment_script_azure_cli" "psql-script" { GRANT ALL PRIVILEGES ON DATABASE $DBNAME TO "$PSQLUSERNAME"; EOF - psql "host=$DBSERVER.postgres.database.azure.com user=$PSQLADMINNAME dbname=$DBNAME port=5432 password=$PSQLADMINPASSWORD sslmode=require" < create_user.sql + psql "host=$DBSERVER user=$PSQLADMINNAME dbname=$DBNAME port=5432 password=$PSQLADMINPASSWORD sslmode=require" < create_user.sql EOT depends_on = [ azurerm_postgresql_flexible_server_database.database ] diff --git a/templates/common/infra/terraform/core/database/postgresql/postgresql_output.tf b/templates/common/infra/terraform/core/database/postgresql/postgresql_output.tf index f99f2403172..7433c455182 100644 --- a/templates/common/infra/terraform/core/database/postgresql/postgresql_output.tf +++ b/templates/common/infra/terraform/core/database/postgresql/postgresql_output.tf @@ -16,5 +16,6 @@ output "AZURE_POSTGRESQL_USERNAME" { } output "AZURE_POSTGRESQL_PASSWORD" { - value = random_password.password[1].result + value = random_password.password[1].result + sensitive = true } \ No newline at end of file