diff --git a/.ci/cloudbuild.test.environments.yaml b/.ci/cloudbuild.test.environments.yaml index 69bd7c9b0..f3d192849 100644 --- a/.ci/cloudbuild.test.environments.yaml +++ b/.ci/cloudbuild.test.environments.yaml @@ -39,7 +39,7 @@ steps: - TF_CLI_CONFIG_FILE=/workspace/.ci/.terraformrc substitutions: - _TERRAFORM_VERSION: 0.13.3 + _TERRAFORM_VERSION: 0.14.5 tags: - "ci" diff --git a/.ci/cloudbuild.test.examples.yaml b/.ci/cloudbuild.test.examples.yaml index 27851e042..ae7d345a1 100644 --- a/.ci/cloudbuild.test.examples.yaml +++ b/.ci/cloudbuild.test.examples.yaml @@ -40,7 +40,7 @@ options: machineType: "N1_HIGHCPU_8" substitutions: - _TERRAFORM_VERSION: 0.13.3 + _TERRAFORM_VERSION: 0.14.5 tags: - "ci" diff --git a/.ci/cloudbuild.test.modules.yaml b/.ci/cloudbuild.test.modules.yaml index c6c0bb075..a96360a15 100644 --- a/.ci/cloudbuild.test.modules.yaml +++ b/.ci/cloudbuild.test.modules.yaml @@ -39,7 +39,7 @@ options: machineType: "N1_HIGHCPU_8" substitutions: - _TERRAFORM_VERSION: 0.13.3 + _TERRAFORM_VERSION: 0.14.5 tags: - "ci" diff --git a/modules/compute-mig/versions.tf b/modules/compute-mig/versions.tf new file mode 100644 index 000000000..a81fa81de --- /dev/null +++ b/modules/compute-mig/versions.tf @@ -0,0 +1,22 @@ +/** + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +terraform { + required_version = ">= 0.12.6" + required_providers { + google-beta = ">= 3.54.0" + } +} diff --git a/modules/iam-service-account/main.tf b/modules/iam-service-account/main.tf index 953fef579..baa60c86a 100644 --- a/modules/iam-service-account/main.tf +++ b/modules/iam-service-account/main.tf @@ -50,7 +50,12 @@ locals { ] ] ]) - key = var.generate_key ? google_service_account_key.key["1"] : {} + # https://github.com/hashicorp/terraform/issues/22405#issuecomment-591917758 + key = try( + var.generate_key + ? google_service_account_key.key["1"] + : map("", null) + , {}) prefix = var.prefix != null ? "${var.prefix}-" : "" resource_iam_email = "serviceAccount:${google_service_account.service_account.email}" } diff --git a/modules/net-vpn-dynamic/README.md b/modules/net-vpn-dynamic/README.md index 8e15f40e6..c84f2a70e 100644 --- a/modules/net-vpn-dynamic/README.md +++ b/modules/net-vpn-dynamic/README.md @@ -63,7 +63,7 @@ module "vpn-dynamic" { | address | VPN gateway address. | | | gateway | VPN gateway resource. | | | name | VPN gateway name. | | -| random_secret | Generated secret. | ✓ | +| random_secret | Generated secret. | | | router | Router resource (only if auto-created). | | | router_name | Router name. | | | self_link | VPN gateway self link. | | diff --git a/modules/net-vpn-dynamic/outputs.tf b/modules/net-vpn-dynamic/outputs.tf index 8217433b6..81a78d5c2 100644 --- a/modules/net-vpn-dynamic/outputs.tf +++ b/modules/net-vpn-dynamic/outputs.tf @@ -70,6 +70,5 @@ output "tunnel_self_links" { output "random_secret" { description = "Generated secret." - sensitive = true value = local.secret } diff --git a/modules/net-vpn-ha/README.md b/modules/net-vpn-ha/README.md index 9fe041766..81c6b5791 100644 --- a/modules/net-vpn-ha/README.md +++ b/modules/net-vpn-ha/README.md @@ -159,7 +159,7 @@ module "vpn_ha" { | external_gateway | External VPN gateway resource. | | | gateway | VPN gateway resource (only if auto-created). | | | name | VPN gateway name (only if auto-created). | | -| random_secret | Generated secret. | ✓ | +| random_secret | Generated secret. | | | router | Router resource (only if auto-created). | | | router_name | Router name. | | | self_link | HA VPN gateway self link. | | diff --git a/modules/net-vpn-ha/outputs.tf b/modules/net-vpn-ha/outputs.tf index 1bd652f46..3e57d2d72 100644 --- a/modules/net-vpn-ha/outputs.tf +++ b/modules/net-vpn-ha/outputs.tf @@ -86,6 +86,5 @@ output "tunnel_self_links" { output "random_secret" { description = "Generated secret." - sensitive = true value = local.secret } diff --git a/modules/net-vpn-static/README.md b/modules/net-vpn-static/README.md index ef1b030dd..96c1f43de 100644 --- a/modules/net-vpn-static/README.md +++ b/modules/net-vpn-static/README.md @@ -54,7 +54,7 @@ module "vpn" { | address | VPN gateway address. | | | gateway | VPN gateway resource. | | | name | VPN gateway name. | | -| random_secret | Generated secret. | ✓ | +| random_secret | Generated secret. | | | self_link | VPN gateway self link. | | | tunnel_names | VPN tunnel names. | | | tunnel_self_links | VPN tunnel self links. | | diff --git a/modules/net-vpn-static/outputs.tf b/modules/net-vpn-static/outputs.tf index e8d885d27..3f7028c1b 100644 --- a/modules/net-vpn-static/outputs.tf +++ b/modules/net-vpn-static/outputs.tf @@ -60,6 +60,5 @@ output "tunnel_self_links" { output "random_secret" { description = "Generated secret." - sensitive = true value = local.secret } diff --git a/modules/compute-vm/versions.tf b/tests/modules/compute_mig/fixture/versions.tf similarity index 100% rename from modules/compute-vm/versions.tf rename to tests/modules/compute_mig/fixture/versions.tf diff --git a/tests/modules/compute_mig/test_plan.py b/tests/modules/compute_mig/test_plan.py index 48ab28377..f0bef7033 100644 --- a/tests/modules/compute_mig/test_plan.py +++ b/tests/modules/compute_mig/test_plan.py @@ -67,7 +67,8 @@ def test_autoscaler(plan_runner): 'metric': [], 'min_replicas': 1, 'mode': 'ON', - 'scale_in_control': [] + 'scale_in_control': [], + 'scaling_schedules': [], }] _, resources = plan_runner( FIXTURES_DIR, autoscaler_config=autoscaler_config, regional='true')