From 2b158fc9a3ef085809257d1ad2e9ca02e120fd7a Mon Sep 17 00:00:00 2001 From: Nick Stogner Date: Fri, 11 Jan 2019 11:13:14 -0800 Subject: [PATCH 1/2] Add google-beta provider to fix deprecation notices --- README.md | 3 ++- examples/gke_shared_vpc/main.tf | 7 ++++++- examples/group_project/main.tf | 7 ++++++- examples/project-hierarchy/main.tf | 7 ++++++- examples/simple_project/main.tf | 7 ++++++- main.tf | 12 ++++++++---- test/fixtures/full/main.tf | 7 ++++++- test/fixtures/full/variables.tf | 3 +-- test/fixtures/minimal/main.tf | 7 ++++++- 9 files changed, 47 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 5e6d64c7..c16f4c81 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 @@ -405,4 +406,4 @@ versions][release-new-version]. [terraform-provider-google]: https://github.com/terraform-providers/terraform-provider-google [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" { From c6af2f0cdd5916684ac49120a8ed012569bf2719 Mon Sep 17 00:00:00 2001 From: Nick Stogner Date: Fri, 11 Jan 2019 11:28:46 -0800 Subject: [PATCH 2/2] Add google-beta provider link to README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c16f4c81..8315c504 100644 --- a/README.md +++ b/README.md @@ -404,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