forked from GoogleCloudPlatform/magic-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Cloud SQL SSL/TLS example (GoogleCloudPlatform#5980)
* Added Cloud SQL SSL/TLS example * Added skip test true to multiple examples * Added missing primary resource type
- Loading branch information
1 parent
3de80e0
commit 74047f8
Showing
2 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
mmv1/templates/terraform/examples/sql_instance_ssl_cert.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# [START cloud_sql_mysql-instance_require_ssl] | ||
resource "google_sql_database_instance" "mysql_instance" { | ||
name = "<%= ctx[:vars]['mysql_instance'] %>" | ||
region = "asia-northeast1" | ||
database_version = "MYSQL_8_0" | ||
settings { | ||
tier = "db-f1-micro" | ||
ip_configuration { | ||
require_ssl = "true" | ||
} | ||
} | ||
deletion_protection = "<%= ctx[:vars]['deletion_protection'] %>" | ||
} | ||
# [END cloud_sql_mysql_instance_require_ssl] | ||
|
||
# [START cloud_sql_mysql_instance_ssl_cert] | ||
resource "google_sql_ssl_cert" "mysql_client_cert" { | ||
common_name = "mysql_common_name" | ||
instance = google_sql_database_instance.mysql_instance.name | ||
} | ||
# [END cloud_sql_mysql_instance_ssl_cert] | ||
|
||
# [START cloud_sql_postgres_instance_require_ssl] | ||
resource "google_sql_database_instance" "postgres_instance" { | ||
name = "<%= ctx[:vars]['postgres_instance'] %>" | ||
region = "asia-northeast1" | ||
database_version = "postgres_14" | ||
settings { | ||
tier = "db-custom-2-7680" | ||
ip_configuration { | ||
require_ssl = "true" | ||
} | ||
} | ||
deletion_protection = "<%= ctx[:vars]['deletion_protection'] %>" | ||
} | ||
# [END cloud_sql_postgres_instance_require_ssl] | ||
|
||
# [START cloud_sql_postgres_instance_ssl_cert] | ||
resource "google_sql_ssl_cert" "postgres_client_cert" { | ||
common_name = "postgres_common_name" | ||
instance = google_sql_database_instance.postgres_instance.name | ||
} | ||
# [END cloud_sql_postgres_instance_ssl_cert] | ||
|
||
# [START cloud_sql_sqlserver_instance_require_ssl] | ||
resource "google_sql_database_instance" "<%= ctx[:primary_resource_id] %>" { | ||
name = "<%= ctx[:vars]['sqlserver_instance'] %>" | ||
region = "asia-northeast1" | ||
database_version = "SQLSERVER_2019_STANDARD" | ||
root_password = "INSERT-PASSWORD-HERE" | ||
settings { | ||
tier = "db-custom-2-7680" | ||
ip_configuration { | ||
require_ssl = "true" | ||
} | ||
} | ||
deletion_protection = "<%= ctx[:vars]['deletion_protection'] %>" | ||
} | ||
# [END cloud_sql_sqlserver_instance_require_ssl] |