This commit is contained in:
17
user.tf
Normal file
17
user.tf
Normal file
@@ -0,0 +1,17 @@
|
||||
locals {
|
||||
database_access = {
|
||||
database_host = google_sql_database_instance.this.ip_address[0].ip_address
|
||||
username = google_sql_user.user.name
|
||||
password = google_sql_user.user.password
|
||||
}
|
||||
}
|
||||
|
||||
resource "random_password" "user_password" {
|
||||
length = 12
|
||||
}
|
||||
|
||||
resource "google_sql_user" "user" {
|
||||
instance = google_sql_database_instance.this.id
|
||||
name = var.database_user_name
|
||||
password = random_password.user_password.result
|
||||
}
|
||||
Reference in New Issue
Block a user