Skip to content

Commit

Permalink
Add support for Password Validation Policy in cloud sql instance. (#6…
Browse files Browse the repository at this point in the history
…329) (#126)

Co-authored-by: Shuya Ma <[email protected]>
Signed-off-by: Modular Magician <[email protected]>

Signed-off-by: Modular Magician <[email protected]>
Co-authored-by: Shuya Ma <[email protected]>
  • Loading branch information
modular-magician and shuyama1 authored Aug 16, 2022
1 parent 23988bd commit 6ff2d2e
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
19 changes: 19 additions & 0 deletions sql_mysql_instance_pvp/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# [START cloud_sql_mysql_instance_pvp]
resource "google_sql_database_instance" "mysql_pvp_instance_name" {
name = "mysql-pvp-instance-name"
region = "asia-northeast1"
database_version = "MYSQL_8_0"
root_password = "abcABC123!"
settings {
tier = "db-f1-micro"
password_validation_policy {
min_length = 6
complexity = "COMPLEXITY_DEFAULT"
reuse_interval = 2
disallow_username_substring = true
enable_password_policy = true
}
}
deletion_protection = "true"
}
# [END cloud_sql_mysql_instance_pvp]
20 changes: 20 additions & 0 deletions sql_postgres_instance_pvp/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# [START cloud_sql_postgres_instance_pvp]
resource "google_sql_database_instance" "postgres_pvp_instance_name" {
name = "postgres-pvp-instance-name"
region = "asia-northeast1"
database_version = "POSTGRES_14"
root_password = "abcABC123!"
settings {
tier = "db-custom-2-7680"
password_validation_policy {
min_length = 6
reuse_interval = 2
complexity = "COMPLEXITY_DEFAULT"
disallow_username_substring = true
password_change_interval = "30s"
enable_password_policy = true
}
}
deletion_protection = "true"
}
# [END cloud_sql_postgres_instance_pvp]

0 comments on commit 6ff2d2e

Please sign in to comment.