Create a Cloud SQL for MSSQL instance with a password validation policy

Creates a Cloud SQL for MSSQL instance with a password validation policy

Code sample

Terraform

To learn how to apply or remove a Terraform configuration, see Basic Terraform commands. For more information, see the Terraform provider reference documentation.

resource "google_sql_database_instance" "default" {
  name             = "mysql-pvp-enterprise-plus-instance-name"
  region           = "us-central1"
  database_version = "MYSQL_8_0"
  root_password    = "abcABC123!"
  settings {
    tier    = "db-perf-optimized-N-2"
    edition = "ENTERPRISE_PLUS"
    password_validation_policy {
      min_length                  = 6
      complexity                  = "COMPLEXITY_DEFAULT"
      reuse_interval              = 2
      disallow_username_substring = true
      enable_password_policy      = true
    }
  }
}

What's next

To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.