Skip to content

Commit

Permalink
Merge pull request #104 from nstogner/google-beta-provider
Browse files Browse the repository at this point in the history
Add google-beta provider to fix deprecation notices
  • Loading branch information
morgante authored Jan 11, 2019
2 parents 7b7fc61 + c6af2f0 commit 5d59bff
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 13 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
[release-new-version]: https://www.terraform.io/docs/registry/modules/publish.html#releasing-new-versions
7 changes: 6 additions & 1 deletion examples/gke_shared_vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
7 changes: 6 additions & 1 deletion examples/group_project/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
7 changes: 6 additions & 1 deletion examples/project-hierarchy/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
7 changes: 6 additions & 1 deletion examples/simple_project/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
12 changes: 8 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
7 changes: 6 additions & 1 deletion test/fixtures/full/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
3 changes: 1 addition & 2 deletions test/fixtures/full/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ variable "folder_id" {
default = ""
}

variable "domain" {
}
variable "domain" {}

variable "usage_bucket_name" {
default = ""
Expand Down
7 changes: 6 additions & 1 deletion test/fixtures/minimal/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down

0 comments on commit 5d59bff

Please sign in to comment.