Skip to content

Commit 04a1f72

Browse files
committed
Add tests for the new SSL types
1 parent 3fe1bbd commit 04a1f72

File tree

3 files changed

+31
-14
lines changed

3 files changed

+31
-14
lines changed

mmv1/products/databasemigrationservice/ConnectionProfile.yaml

+29-6
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,32 @@ examples:
7171
- 'postgresql.0.ssl.0.ca_certificate'
7272
- 'postgresql.0.ssl.0.client_certificate'
7373
- 'postgresql.0.ssl.0.client_key'
74+
- name: 'database_migration_service_connection_profile_postgres_no_ssl'
75+
primary_resource_id: 'postgresprofile'
76+
vars:
77+
sqldb: 'my-database'
78+
sqldb_cert: 'my-cert'
79+
sqldb_user: 'my-username'
80+
sqldb_pass: 'my-password'
81+
profile: 'my-profileid'
82+
ignore_read_extra:
83+
- 'postgresql.0.password'
84+
- 'postgresql.0.ssl.0.ca_certificate'
85+
- 'postgresql.0.ssl.0.client_certificate'
86+
- 'postgresql.0.ssl.0.client_key'
87+
- name: 'database_migration_service_connection_profile_postgres_required_ssl'
88+
primary_resource_id: 'postgresprofile'
89+
vars:
90+
sqldb: 'my-database'
91+
sqldb_cert: 'my-cert'
92+
sqldb_user: 'my-username'
93+
sqldb_pass: 'my-password'
94+
profile: 'my-profileid'
95+
ignore_read_extra:
96+
- 'postgresql.0.password'
97+
- 'postgresql.0.ssl.0.ca_certificate'
98+
- 'postgresql.0.ssl.0.client_certificate'
99+
- 'postgresql.0.ssl.0.client_key'
74100
- name: 'database_migration_service_connection_profile_oracle'
75101
primary_resource_id: 'oracleprofile'
76102
vars:
@@ -256,9 +282,8 @@ properties:
256282
- name: 'caCertificate'
257283
type: String
258284
description: |
259-
Required. Input only. The x509 PEM-encoded certificate of the CA that signed the source database server's certificate.
285+
Input only. The x509 PEM-encoded certificate of the CA that signed the source database server's certificate.
260286
The replica will use this certificate to verify it's connecting to the right host.
261-
required: true
262287
immutable: true
263288
sensitive: true
264289
custom_flatten: 'templates/terraform/custom_flatten/database_migration_service_connection_profile_mysql_ssl_ca_certificate.go.tmpl'
@@ -355,9 +380,8 @@ properties:
355380
- name: 'caCertificate'
356381
type: String
357382
description: |
358-
Required. Input only. The x509 PEM-encoded certificate of the CA that signed the source database server's certificate.
383+
Input only. The x509 PEM-encoded certificate of the CA that signed the source database server's certificate.
359384
The replica will use this certificate to verify it's connecting to the right host.
360-
required: true
361385
immutable: true
362386
sensitive: true
363387
custom_flatten: 'templates/terraform/custom_flatten/database_migration_service_connection_profile_postgresql_ssl_ca_certificate.go.tmpl'
@@ -458,9 +482,8 @@ properties:
458482
- name: 'caCertificate'
459483
type: String
460484
description: |
461-
Required. Input only. The x509 PEM-encoded certificate of the CA that signed the source database server's certificate.
485+
Input only. The x509 PEM-encoded certificate of the CA that signed the source database server's certificate.
462486
The replica will use this certificate to verify it's connecting to the right host.
463-
required: true
464487
immutable: true
465488
sensitive: true
466489
custom_flatten: 'templates/terraform/custom_flatten/database_migration_service_connection_profile_oracle_ssl_ca_certificate.go.tmpl'

mmv1/templates/terraform/examples/database_migration_service_connection_profile_postgres_no_ssl.tf.tmpl

+1-4
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@ resource "google_database_migration_service_connection_profile" "{{$.PrimaryReso
3636
username = google_sql_user.sqldb_user.name
3737
password = google_sql_user.sqldb_user.password
3838
ssl {
39-
client_key = google_sql_ssl_cert.sql_client_cert.private_key
40-
client_certificate = google_sql_ssl_cert.sql_client_cert.cert
41-
ca_certificate = google_sql_ssl_cert.sql_client_cert.server_ca_cert
42-
type = "SERVER_CLIENT"
39+
type = "NONE"
4340
}
4441
cloud_sql_id = "{{index $.Vars "sqldb"}}"
4542
}

mmv1/templates/terraform/examples/database_migration_service_connection_profile_postgres_required_ssl.tf.tmpl

+1-4
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@ resource "google_database_migration_service_connection_profile" "{{$.PrimaryReso
3636
username = google_sql_user.sqldb_user.name
3737
password = google_sql_user.sqldb_user.password
3838
ssl {
39-
client_key = google_sql_ssl_cert.sql_client_cert.private_key
40-
client_certificate = google_sql_ssl_cert.sql_client_cert.cert
41-
ca_certificate = google_sql_ssl_cert.sql_client_cert.server_ca_cert
42-
type = "SERVER_CLIENT"
39+
type = "REQUIRED"
4340
}
4441
cloud_sql_id = "{{index $.Vars "sqldb"}}"
4542
}

0 commit comments

Comments
 (0)