Skip to content

Commit

Permalink
Add purpose and role to subnetwork for L7 load balancing (#2184)
Browse files Browse the repository at this point in the history
Merged PR #2184.
  • Loading branch information
Ty Larrabee authored and modular-magician committed Sep 3, 2019
1 parent 6b16452 commit 3212fb4
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build/terraform
2 changes: 1 addition & 1 deletion build/terraform-beta
29 changes: 29 additions & 0 deletions products/compute/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7136,6 +7136,35 @@ objects:
updates of this resource.
update_verb: :PATCH
update_url: projects/{{project}}/regions/{{region}}/subnetworks/{{name}}
- !ruby/object:Api::Type::Enum
name: 'purpose'
min_version: 'beta'
input: true
values:
- :INTERNAL_HTTPS_LOAD_BALANCER
- :PRIVATE_RFC_1918
- :PRIVATE
description: |
The purpose of the resource. This field can be either PRIVATE_RFC_1918
or INTERNAL_HTTPS_LOAD_BALANCER. A subnetwork with purpose set to
INTERNAL_HTTPS_LOAD_BALANCER is a user-created subnetwork that is
reserved for Internal HTTP(S) Load Balancing.
If set to INTERNAL_HTTPS_LOAD_BALANCER you must also set the role.
- !ruby/object:Api::Type::Enum
name: 'role'
min_version: 'beta'
update_verb: :PATCH
update_url: projects/{{project}}/regions/{{region}}/subnetworks/{{name}}
values:
- :ACTIVE
- :BACKUP
description: |
The role of subnetwork. Currenly, this field is only used
when purpose = INTERNAL_HTTPS_LOAD_BALANCER. The value can be set
to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently
being used for Internal HTTP(S) Load Balancing. A BACKUP subnetwork
is one that is ready to be promoted to ACTIVE or is currently draining.
- !ruby/object:Api::Type::Array
name: 'secondaryIpRanges'
description: |
Expand Down
7 changes: 7 additions & 0 deletions products/compute/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1381,6 +1381,13 @@ overrides: !ruby/object:Overrides::ResourceOverrides
vars:
subnetwork_name: "log-test-subnetwork"
network_name: "log-test-network"
- !ruby/object:Provider::Terraform::Examples
name: "subnetwork_internal_l7lb"
primary_resource_id: "network-for-l7lb"
min_version: beta
vars:
subnetwork_name: "l7lb-test-subnetwork"
network_name: "l7lb-test-network"
TargetHttpProxy: !ruby/object:Overrides::Terraform::ResourceOverride
examples:
- !ruby/object:Provider::Terraform::Examples
Expand Down
20 changes: 20 additions & 0 deletions templates/terraform/examples/subnetwork_internal_l7lb.tf.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
provider "google-beta" {
region = "us-central1"
zone = "us-central1-a"
}

resource "google_compute_subnetwork" "network-for-l7lb" {
provider = "google-beta"
name = "<%= ctx[:vars]['subnetwork_name'] %>"
ip_cidr_range = "10.0.0.0/22"
region = "us-central1"
purpose = "INTERNAL_HTTPS_LOAD_BALANCER"
role = "ACTIVE"
network = "${google_compute_network.custom-test.self_link}"
}

resource "google_compute_network" "custom-test" {
provider = "google-beta"
name = "<%= ctx[:vars]['network_name'] %>"
auto_create_subnetworks = false
}

0 comments on commit 3212fb4

Please sign in to comment.