diff --git a/README.md b/README.md index 5e6d64c7..8315c504 100644 --- a/README.md +++ b/README.md @@ -156,6 +156,7 @@ The project has the following folders and files: - [Terraform](https://www.terraform.io/downloads.html) 0.10.x - [terraform-provider-google] plugin 1.19.x +- [terraform-provider-google-beta] plugin 1.19.x - [terraform-provider-gsuite] plugin 0.1.x if GSuite functionality is desired ### Permissions @@ -403,6 +404,7 @@ See the Terraform documentation for more info on [releasing new versions][release-new-version]. [terraform-provider-google]: https://github.com/terraform-providers/terraform-provider-google +[terraform-provider-google-beta]: https://github.com/terraform-providers/terraform-provider-google-beta [terraform-provider-gsuite]: https://github.com/DeviaVir/terraform-provider-gsuite [glossary]: /docs/GLOSSARY.md -[release-new-version]: https://www.terraform.io/docs/registry/modules/publish.html#releasing-new-versions \ No newline at end of file +[release-new-version]: https://www.terraform.io/docs/registry/modules/publish.html#releasing-new-versions diff --git a/examples/gke_shared_vpc/main.tf b/examples/gke_shared_vpc/main.tf index 738c4b46..ab210b49 100644 --- a/examples/gke_shared_vpc/main.tf +++ b/examples/gke_shared_vpc/main.tf @@ -20,7 +20,12 @@ locals { provider "google" { credentials = "${file(local.credentials_file_path)}" - version = "~> 1.19" + version = "~> 1.19" +} + +provider "google-beta" { + credentials = "${file(local.credentials_file_path)}" + version = "~> 1.19" } module "project-factory" { diff --git a/examples/group_project/main.tf b/examples/group_project/main.tf index 3a2ff1ad..d7f3460d 100755 --- a/examples/group_project/main.tf +++ b/examples/group_project/main.tf @@ -23,7 +23,12 @@ locals { *****************************************/ provider "google" { credentials = "${file(local.credentials_file_path)}" - version = "~> 1.19" + version = "~> 1.19" +} + +provider "google-beta" { + credentials = "${file(local.credentials_file_path)}" + version = "~> 1.19" } provider "gsuite" { diff --git a/examples/project-hierarchy/main.tf b/examples/project-hierarchy/main.tf index 871fff8f..d36bb0a8 100755 --- a/examples/project-hierarchy/main.tf +++ b/examples/project-hierarchy/main.tf @@ -23,7 +23,12 @@ locals { *****************************************/ provider "google" { credentials = "${file(local.credentials_file_path)}" - version = "~> 1.19" + version = "~> 1.19" +} + +provider "google-beta" { + credentials = "${file(local.credentials_file_path)}" + version = "~> 1.19" } provider "gsuite" { diff --git a/examples/simple_project/main.tf b/examples/simple_project/main.tf index d99c2dac..d3e20b8a 100755 --- a/examples/simple_project/main.tf +++ b/examples/simple_project/main.tf @@ -23,7 +23,12 @@ locals { *****************************************/ provider "google" { credentials = "${file(local.credentials_file_path)}" - version = "~> 1.19" + version = "~> 1.19" +} + +provider "google-beta" { + credentials = "${file(local.credentials_file_path)}" + version = "~> 1.19" } provider "gsuite" { diff --git a/main.tf b/main.tf index 7972f966..94ad6142 100755 --- a/main.tf +++ b/main.tf @@ -244,7 +244,8 @@ resource "google_project_iam_member" "controlling_group_vpc_membership" { compute.networkUser role granted to Project Service Account on vpc subnets *************************************************************************************/ resource "google_compute_subnetwork_iam_member" "service_account_role_to_vpc_subnets" { - count = "${var.shared_vpc != "" && length(compact(var.shared_vpc_subnets)) > 0 ? length(var.shared_vpc_subnets) : 0 }" + provider = "google-beta" + count = "${var.shared_vpc != "" && length(compact(var.shared_vpc_subnets)) > 0 ? length(var.shared_vpc_subnets) : 0 }" subnetwork = "${element(split("/", var.shared_vpc_subnets[count.index]), 5)}" role = "roles/compute.networkUser" @@ -257,7 +258,8 @@ resource "google_compute_subnetwork_iam_member" "service_account_role_to_vpc_sub compute.networkUser role granted to GSuite group on vpc subnets *************************************************************************************/ resource "google_compute_subnetwork_iam_member" "group_role_to_vpc_subnets" { - count = "${var.shared_vpc != "" && length(compact(var.shared_vpc_subnets)) > 0 && local.gsuite_group ? length(var.shared_vpc_subnets) : 0 }" + provider = "google-beta" + count = "${var.shared_vpc != "" && length(compact(var.shared_vpc_subnets)) > 0 && local.gsuite_group ? length(var.shared_vpc_subnets) : 0 }" subnetwork = "${element(split("/", var.shared_vpc_subnets[count.index]), 5)}" role = "roles/compute.networkUser" @@ -270,7 +272,8 @@ resource "google_compute_subnetwork_iam_member" "group_role_to_vpc_subnets" { compute.networkUser role granted to APIs Service Account on vpc subnets *************************************************************************************/ resource "google_compute_subnetwork_iam_member" "apis_service_account_role_to_vpc_subnets" { - count = "${var.shared_vpc != "" && length(compact(var.shared_vpc_subnets)) > 0 ? length(var.shared_vpc_subnets) : 0 }" + provider = "google-beta" + count = "${var.shared_vpc != "" && length(compact(var.shared_vpc_subnets)) > 0 ? length(var.shared_vpc_subnets) : 0 }" subnetwork = "${element(split("/", var.shared_vpc_subnets[count.index]), 5)}" role = "roles/compute.networkUser" @@ -343,7 +346,8 @@ resource "google_storage_bucket_iam_member" "api_s_account_storage_admin_on_proj compute.networkUser role granted to GKE service account for GKE on shared VPC subnets *****************************************/ resource "google_compute_subnetwork_iam_member" "gke_shared_vpc_subnets" { - count = "${local.gke_shared_vpc_enabled && length(compact(var.shared_vpc_subnets)) != 0 ? length(var.shared_vpc_subnets) : 0}" + provider = "google-beta" + count = "${local.gke_shared_vpc_enabled && length(compact(var.shared_vpc_subnets)) != 0 ? length(var.shared_vpc_subnets) : 0}" subnetwork = "${element(split("/", var.shared_vpc_subnets[count.index]), 5)}" role = "roles/compute.networkUser" diff --git a/test/fixtures/full/main.tf b/test/fixtures/full/main.tf index faf39d6f..49346d48 100644 --- a/test/fixtures/full/main.tf +++ b/test/fixtures/full/main.tf @@ -16,7 +16,12 @@ provider "google" { credentials = "${file(var.credentials_path)}" - version = "~> 1.19" + version = "~> 1.19" +} + +provider "google-beta" { + credentials = "${file(var.credentials_path)}" + version = "~> 1.19" } provider "gsuite" { diff --git a/test/fixtures/full/variables.tf b/test/fixtures/full/variables.tf index bd0c0075..1c7bc75a 100644 --- a/test/fixtures/full/variables.tf +++ b/test/fixtures/full/variables.tf @@ -26,8 +26,7 @@ variable "folder_id" { default = "" } -variable "domain" { -} +variable "domain" {} variable "usage_bucket_name" { default = "" diff --git a/test/fixtures/minimal/main.tf b/test/fixtures/minimal/main.tf index 7dab5600..25b50c79 100644 --- a/test/fixtures/minimal/main.tf +++ b/test/fixtures/minimal/main.tf @@ -16,7 +16,12 @@ provider "google" { credentials = "${file(var.credentials_path)}" - version = "~> 1.19" + version = "~> 1.19" +} + +provider "google-beta" { + credentials = "${file(var.credentials_path)}" + version = "~> 1.19" } provider "gsuite" {