Skip to content

Commit

Permalink
terraform update
Browse files Browse the repository at this point in the history
  • Loading branch information
fangjian0423 committed Jul 25, 2023
1 parent d5f3eb0 commit aa152d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit aa152d7

Please sign in to comment.