Skip to content

Commit

Permalink
Added edition field to CloudSQL settings in DMS connection profile (G…
Browse files Browse the repository at this point in the history
…oogleCloudPlatform#8602)

* feat: added edition field to cloudsql settings

* chore: formatted example file
  • Loading branch information
DanielRieske authored Aug 15, 2023
1 parent c4ff4eb commit b2d4ee2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 24 deletions.
7 changes: 7 additions & 0 deletions mmv1/products/databasemigrationservice/connectionprofile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,13 @@ properties:
name: 'cmekKeyName'
description: |
The KMS key name used for the csql instance.
- !ruby/object:Api::Type::Enum
name: 'edition'
description: |
The edition of the given Cloud SQL instance.
values:
- :ENTERPRISE
- :ENTERPRISE_PLUS
- !ruby/object:Api::Type::String
name: 'privateIp'
output: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ resource "google_sql_database_instance" "cloudsqldb" {

resource "google_sql_ssl_cert" "sql_client_cert" {
common_name = "<%= ctx[:vars]["sqldb_cert"] %>"
instance = google_sql_database_instance.cloudsqldb.name
instance = google_sql_database_instance.cloudsqldb.name

depends_on = [google_sql_database_instance.cloudsqldb]
}
Expand All @@ -29,21 +29,21 @@ resource "google_sql_user" "sqldb_user" {


resource "google_database_migration_service_connection_profile" "<%= ctx[:primary_resource_id] %>" {
location = "us-central1"
location = "us-central1"
connection_profile_id = "<%= ctx[:vars]["from_profile"] %>"
display_name = "<%= ctx[:vars]["from_profile"] %>_display"
display_name = "<%= ctx[:vars]["from_profile"] %>_display"
labels = {
foo = "bar"
}
mysql {
host = google_sql_database_instance.cloudsqldb.ip_address.0.ip_address
port = 3306
host = google_sql_database_instance.cloudsqldb.ip_address.0.ip_address
port = 3306
username = google_sql_user.sqldb_user.name
password = google_sql_user.sqldb_user.password
ssl {
client_key = google_sql_ssl_cert.sql_client_cert.private_key
client_key = google_sql_ssl_cert.sql_client_cert.private_key
client_certificate = google_sql_ssl_cert.sql_client_cert.cert
ca_certificate = google_sql_ssl_cert.sql_client_cert.server_ca_cert
ca_certificate = google_sql_ssl_cert.sql_client_cert.server_ca_cert
}
cloud_sql_id = "<%= ctx[:vars]["sqldb"] %>"
}
Expand All @@ -53,9 +53,9 @@ resource "google_database_migration_service_connection_profile" "<%= ctx[:primar


resource "google_database_migration_service_connection_profile" "<%= ctx[:primary_resource_id] %>_destination" {
location = "us-central1"
location = "us-central1"
connection_profile_id = "<%= ctx[:vars]["to_profile"] %>"
display_name = "<%= ctx[:vars]["to_profile"] %>_displayname"
display_name = "<%= ctx[:vars]["to_profile"] %>_displayname"
labels = {
foo = "bar"
}
Expand All @@ -65,22 +65,21 @@ resource "google_database_migration_service_connection_profile" "<%= ctx[:primar
user_labels = {
cloudfoo = "cloudbar"
}
tier = "db-n1-standard-1"
storage_auto_resize_limit = "0"
activation_policy = "ALWAYS"
ip_config {
enable_ipv4 = true
require_ssl = "true"
}
auto_storage_increase = true
data_disk_type = "PD_HDD"
data_disk_size_gb = "11"
zone = "us-central1-b"
source_id = "projects/${data.google_project.project.project_id}/locations/us-central1/connectionProfiles/<%= ctx[:vars]["from_profile"] %>"
root_password = "testpasscloudsql"
tier = "db-n1-standard-1"
edition = "ENTERPRISE"
storage_auto_resize_limit = "0"
activation_policy = "ALWAYS"
ip_config {
enable_ipv4 = true
require_ssl = true
}
auto_storage_increase = true
data_disk_type = "PD_HDD"
data_disk_size_gb = "11"
zone = "us-central1-b"
source_id = "projects/${data.google_project.project.project_id}/locations/us-central1/connectionProfiles/<%= ctx[:vars]["from_profile"] %>"
root_password = "testpasscloudsql"
}


}
depends_on = [google_database_migration_service_connection_profile.<%= ctx[:primary_resource_id] %>]
}

0 comments on commit b2d4ee2

Please sign in to comment.