From 5b006736344bb125c2416c7a5d37038798112374 Mon Sep 17 00:00:00 2001 From: Bharath KKB Date: Mon, 29 Mar 2021 14:55:25 -0500 Subject: [PATCH] fix: Switch shared_vpc resources to beta provider in access submodule (#269) --- modules/fabric-net-svpc-access/main.tf | 2 ++ modules/fabric-net-svpc-access/versions.tf | 7 +++++++ modules/vpc/main.tf | 2 ++ modules/vpc/versions.tf | 7 +++++++ 4 files changed, 18 insertions(+) diff --git a/modules/fabric-net-svpc-access/main.tf b/modules/fabric-net-svpc-access/main.tf index a51c74b7..32975646 100644 --- a/modules/fabric-net-svpc-access/main.tf +++ b/modules/fabric-net-svpc-access/main.tf @@ -15,6 +15,8 @@ */ resource "google_compute_shared_vpc_service_project" "projects" { + provider = google-beta + count = var.service_project_num host_project = var.host_project_id service_project = element(var.service_project_ids, count.index) diff --git a/modules/fabric-net-svpc-access/versions.tf b/modules/fabric-net-svpc-access/versions.tf index 4fda23ba..48c51b5b 100644 --- a/modules/fabric-net-svpc-access/versions.tf +++ b/modules/fabric-net-svpc-access/versions.tf @@ -21,9 +21,16 @@ terraform { source = "hashicorp/google" version = "<4.0,>= 2.12" } + google-beta = { + source = "hashicorp/google-beta" + version = "<4.0,>= 2.12" + } } provider_meta "google" { module_name = "blueprints/terraform/terraform-google-network:fabric-net-svpc-access/v3.2.0" } + provider_meta "google-beta" { + module_name = "blueprints/terraform/terraform-google-network:fabric-net-svpc-access/v3.2.0" + } } diff --git a/modules/vpc/main.tf b/modules/vpc/main.tf index c8663b34..6ed237a5 100644 --- a/modules/vpc/main.tf +++ b/modules/vpc/main.tf @@ -31,6 +31,8 @@ resource "google_compute_network" "network" { Shared VPC *****************************************/ resource "google_compute_shared_vpc_host_project" "shared_vpc_host" { + provider = google-beta + count = var.shared_vpc_host ? 1 : 0 project = var.project_id depends_on = [google_compute_network.network] diff --git a/modules/vpc/versions.tf b/modules/vpc/versions.tf index 079f065c..bd38edce 100644 --- a/modules/vpc/versions.tf +++ b/modules/vpc/versions.tf @@ -21,9 +21,16 @@ terraform { source = "hashicorp/google" version = "~> 3.45" } + google-beta = { + source = "hashicorp/google-beta" + version = "~> 3.45" + } } provider_meta "google" { module_name = "blueprints/terraform/terraform-google-network:vpc/v3.2.0" } + provider_meta "google-beta" { + module_name = "blueprints/terraform/terraform-google-network:vpc/v3.2.0" + } }