From d5ea29dc227f43034f12efc1b89767954728ac71 Mon Sep 17 00:00:00 2001 From: rob salmond Date: Tue, 9 Apr 2019 17:02:40 -0600 Subject: [PATCH 1/3] replace hazardous tf patterns with better patterns --- .../docs/d/google_kms_secret.html.markdown | 6 +++++- .../website/docs/r/sql_database.html.markdown | 6 +++++- .../docs/r/sql_database_instance.html.markdown | 18 +++++++++++++++--- .../website/docs/r/sql_ssl_cert.html.markdown | 6 +++++- .../website/docs/r/sql_user.html.markdown | 6 +++++- 5 files changed, 35 insertions(+), 7 deletions(-) diff --git a/third_party/terraform/website/docs/d/google_kms_secret.html.markdown b/third_party/terraform/website/docs/d/google_kms_secret.html.markdown index 92454928ec10..359738dc4fc8 100644 --- a/third_party/terraform/website/docs/d/google_kms_secret.html.markdown +++ b/third_party/terraform/website/docs/d/google_kms_secret.html.markdown @@ -59,8 +59,12 @@ data "google_kms_secret" "sql_user_password" { ciphertext = "CiQAqD+xX4SXOSziF4a8JYvq4spfAuWhhYSNul33H85HnVtNQW4SOgDu2UZ46dQCRFl5MF6ekabviN8xq+F+2035ZJ85B+xTYXqNf4mZs0RJitnWWuXlYQh6axnnJYu3kDU=" } +resource "random_id" "db_name_suffix" { + byte_length = 4 +} + resource "google_sql_database_instance" "master" { - name = "master-instance" + name = "master-instance-${random_id.db_name_suffix.hex}" settings { tier = "D0" diff --git a/third_party/terraform/website/docs/r/sql_database.html.markdown b/third_party/terraform/website/docs/r/sql_database.html.markdown index 948c49c761a6..8395517fb67d 100644 --- a/third_party/terraform/website/docs/r/sql_database.html.markdown +++ b/third_party/terraform/website/docs/r/sql_database.html.markdown @@ -17,8 +17,12 @@ or the [JSON API](https://cloud.google.com/sql/docs/admin-api/v1beta4/databases) Example creating a SQL Database. ```hcl +resource "random_id" "db_name_suffix" { + byte_length = 4 +} + resource "google_sql_database_instance" "master" { - name = "master-instance" + name = "master-instance-${random_id.db_name_suffix.hex}" settings { tier = "D0" diff --git a/third_party/terraform/website/docs/r/sql_database_instance.html.markdown b/third_party/terraform/website/docs/r/sql_database_instance.html.markdown index de29222b58d6..e3bcc4944e57 100644 --- a/third_party/terraform/website/docs/r/sql_database_instance.html.markdown +++ b/third_party/terraform/website/docs/r/sql_database_instance.html.markdown @@ -21,8 +21,12 @@ a restricted host and strong password. ### SQL First Generation ```hcl +resource "random_id" "db_name_suffix" { + byte_length = 4 +} + resource "google_sql_database_instance" "master" { - name = "master-instance" + name = "master-instance-${random_id.db_name_suffix.hex}" database_version = "MYSQL_5_6" # First-generation instance regions are not the conventional # Google Compute Engine regions. See argument reference below. @@ -91,8 +95,12 @@ data "null_data_source" "auth_netw_postgres_allowed_2" { } } +resource "random_id" "db_name_suffix" { + byte_length = 4 +} + resource "google_sql_database_instance" "postgres" { - name = "postgres-instance" + name = "postgres-instance-${random_id.db_name_suffix.hex}" database_version = "POSTGRES_9_6" settings { @@ -136,10 +144,14 @@ resource "google_service_networking_connection" "private_vpc_connection" { reserved_peering_ranges = ["${google_compute_global_address.private_ip_address.name}"] } +resource "random_id" "db_name_suffix" { + byte_length = 4 +} + resource "google_sql_database_instance" "instance" { provider = "google-beta" - name = "private-instance" + name = "private-instance-${random_id.db_name_suffix.hex}" region = "us-central1" depends_on = [ diff --git a/third_party/terraform/website/docs/r/sql_ssl_cert.html.markdown b/third_party/terraform/website/docs/r/sql_ssl_cert.html.markdown index 8c9113772f71..547507fc99d0 100644 --- a/third_party/terraform/website/docs/r/sql_ssl_cert.html.markdown +++ b/third_party/terraform/website/docs/r/sql_ssl_cert.html.markdown @@ -18,8 +18,12 @@ Creates a new Google SQL SSL Cert on a Google SQL Instance. For more information Example creating a SQL Client Certificate. ```hcl +resource "random_id" "db_name_suffix" { + byte_length = 4 +} + resource "google_sql_database_instance" "master" { - name = "master-instance" + name = "master-instance-${random_id.db_name_suffix.hex}" settings { tier = "D0" diff --git a/third_party/terraform/website/docs/r/sql_user.html.markdown b/third_party/terraform/website/docs/r/sql_user.html.markdown index 1628adb899ba..8ed3d280a56d 100644 --- a/third_party/terraform/website/docs/r/sql_user.html.markdown +++ b/third_party/terraform/website/docs/r/sql_user.html.markdown @@ -19,8 +19,12 @@ Creates a new Google SQL User on a Google SQL User Instance. For more informatio Example creating a SQL User. ```hcl +resource "random_id" "db_name_suffix" { + byte_length = 4 +} + resource "google_sql_database_instance" "master" { - name = "master-instance" + name = "master-instance-${random_id.db_name_suffix.hex}" settings { tier = "D0" From 63f3f5de210a9c0ed9ece951a19ac80fc8c59967 Mon Sep 17 00:00:00 2001 From: rob salmond Date: Tue, 9 Apr 2019 17:12:26 -0600 Subject: [PATCH 2/3] whitespace fix --- .../terraform/website/docs/d/google_kms_secret.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/terraform/website/docs/d/google_kms_secret.html.markdown b/third_party/terraform/website/docs/d/google_kms_secret.html.markdown index 359738dc4fc8..6ad424e519b3 100644 --- a/third_party/terraform/website/docs/d/google_kms_secret.html.markdown +++ b/third_party/terraform/website/docs/d/google_kms_secret.html.markdown @@ -64,7 +64,7 @@ resource "random_id" "db_name_suffix" { } resource "google_sql_database_instance" "master" { - name = "master-instance-${random_id.db_name_suffix.hex}" + name = "master-instance-${random_id.db_name_suffix.hex}" settings { tier = "D0" From 2561a8cabc6b0664417c8bf3d8702c0e076d8e7b Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Tue, 7 May 2019 16:34:03 +0000 Subject: [PATCH 3/3] Update tracked submodules -> HEAD on Tue May 7 16:34:03 UTC 2019 Tracked submodules are build/terraform-beta build/terraform-mapper build/terraform build/ansible build/inspec. --- build/terraform | 2 +- build/terraform-beta | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/terraform b/build/terraform index d43a1795b4c1..0a667ddfe73c 160000 --- a/build/terraform +++ b/build/terraform @@ -1 +1 @@ -Subproject commit d43a1795b4c1ee45d15d83ba33b588448f3ff392 +Subproject commit 0a667ddfe73cf3de371d93361fc76e43f4500fff diff --git a/build/terraform-beta b/build/terraform-beta index 2d3866cc9bd6..1bfc43b79682 160000 --- a/build/terraform-beta +++ b/build/terraform-beta @@ -1 +1 @@ -Subproject commit 2d3866cc9bd68f9d4e7e2a263d1ba264cf06956c +Subproject commit 1bfc43b79682bbc538a43db65914cb283f81522b