hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.32k stars 1.73k forks source link

SQL Server support for google_database_migration_service_connection_profile is missing #19721

Open mariusmitrofan opened 6 days ago

mariusmitrofan commented 6 days ago

Community Note

Description

The resource google_database_migration_service_connection_profile is missing support for the SQL Server connection.

The API is already live - https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.connectionProfiles#sqlserverconnectionprofile

New or Affected Resource(s)

Potential Terraform Configuration

resource "google_database_migration_service_connection_profile" "destination" {
  location                      = var.gcp_region
  connection_profile_id = "${var.gcp_sql_identifier}-destination"
  display_name              = "${var.gcp_sql_identifier}-destination"

  sqlserver {
    host         = data.google_sql_database_instance.destination.ip_address.0.ip_address
    port         = 1433
    username     = google_sql_user.destination.name
    password     = google_sql_user.destination.password
    cloud_sql_id = data.google_sql_database_instance.destination.name
    ssl {
      client_key         = google_sql_ssl_cert.destination.private_key
      client_certificate = google_sql_ssl_cert.destination.cert
      ca_certificate     = google_sql_ssl_cert.destination.server_ca_cert
    }
    backups {
      gcs_bucket = google_storage_bucket.gcp_sql_dump_bucket.name
      gcs_prefix = ""
    }
  }

  labels = var.labels
}

References

https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.connectionProfiles#sqlserverconnectionprofile

b/372208238

SarahFrench commented 6 hours ago

Note from triage: We should add support for the sqlserver field in the resource and make sure that it conflicts with the other possible settings for Union field connection_profile.