Skip to content

Commit

Permalink
feat: Allow global access to internal loadbalancers with var.global_a…
Browse files Browse the repository at this point in the history
…ccess (#34)
  • Loading branch information
GeneralAardvark authored May 27, 2020
1 parent eb96515 commit 4c0a9cf
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 15 deletions.
4 changes: 2 additions & 2 deletions examples/minimal/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

provider google {
version = "~> 2.20"
version = "~> 3.14.0"
}

provider "random" {
Expand Down Expand Up @@ -64,7 +64,7 @@ resource "google_compute_subnetwork" "test" {
}

module "test_ilb" {
source = "../../"
source = "../../"
project = var.project_id
network = google_compute_network.test.name
subnetwork = google_compute_subnetwork.test.name
Expand Down
4 changes: 2 additions & 2 deletions examples/simple/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

provider "google" {
version = "~> 2.20"
version = "~> 3.14.0"
}

module "gce-lb-fr" {
Expand All @@ -30,7 +30,7 @@ module "gce-lb-fr" {
}

module "gce-ilb" {
source = "../../"
source = "../../"
project = var.project
region = var.region
name = "group-ilb"
Expand Down
12 changes: 6 additions & 6 deletions examples/simple/mig.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

module "instance_template1" {
source = "terraform-google-modules/vm/google//modules/instance_template"
version = "~> 1.1"
version = "~> 2.1.0"
project_id = var.project
subnetwork = var.subnetwork
subnetwork_project = var.subnetwork_project
Expand All @@ -27,7 +27,7 @@ module "instance_template1" {

module "instance_template2" {
source = "terraform-google-modules/vm/google//modules/instance_template"
version = "~> 1.1"
version = "~> 2.1.0"
project_id = var.project
subnetwork = var.subnetwork
subnetwork_project = var.subnetwork_project
Expand All @@ -38,7 +38,7 @@ module "instance_template2" {

module "instance_template3" {
source = "terraform-google-modules/vm/google//modules/instance_template"
version = "~> 1.1"
version = "~> 2.1.0"
project_id = var.project
subnetwork = var.subnetwork
subnetwork_project = var.subnetwork_project
Expand All @@ -49,7 +49,7 @@ module "instance_template3" {

module "mig1" {
source = "terraform-google-modules/vm/google//modules/mig"
version = "~> 1.1"
version = "~> 2.1.0"
project_id = var.project
subnetwork_project = var.subnetwork_project
region = var.region
Expand All @@ -61,7 +61,7 @@ module "mig1" {

module "mig2" {
source = "terraform-google-modules/vm/google//modules/mig"
version = "~> 1.1"
version = "~> 2.1.0"
project_id = var.project
subnetwork_project = var.subnetwork_project
region = var.region
Expand All @@ -72,7 +72,7 @@ module "mig2" {

module "mig3" {
source = "terraform-google-modules/vm/google//modules/mig"
version = "~> 1.1"
version = "~> 2.1.0"
project_id = var.project
subnetwork_project = var.subnetwork_project
region = var.region
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ resource "google_compute_forwarding_rule" "default" {
region = var.region
network = data.google_compute_network.network.self_link
subnetwork = data.google_compute_subnetwork.network.self_link
allow_global_access = var.global_access
load_balancing_scheme = "INTERNAL"
backend_service = google_compute_region_backend_service.default.self_link
ip_address = var.ip_address
Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/minimal/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

module "example" {
source = "../../../examples/minimal"
region = var.region
project_id = var.project_id
source = "../../../examples/minimal"
region = var.region
project_id = var.project_id
}
2 changes: 1 addition & 1 deletion test/setup/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

module "project-ci-lb-internal" {
source = "terraform-google-modules/project-factory/google"
version = "~> 3.0"
version = "~> 4.0"

name = "ci-int-lb-internal"
random_project_id = "true"
Expand Down
2 changes: 1 addition & 1 deletion test/setup/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ terraform {
}

provider "google" {
version = "~> 2.13.0"
version = "~> 3.14.0"
}

provider "google-beta" {
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ variable "region" {
default = "us-central1"
}

variable "global_access" {
description = "Allow all regions on the same VPC network access."
type = bool
default = false
}

variable "network" {
description = "Name of the network to create resources in."
default = "default"
Expand Down

0 comments on commit 4c0a9cf

Please sign in to comment.