Skip to content

Commit

Permalink
Add SHARED_LOADBALANCER_VIP as option for google_compute_address.purp…
Browse files Browse the repository at this point in the history
…ose (#3629)

* Add SHARED_LOADBALANCER_VIP as option for google_compute_address.purpose

* Update products/compute/api.yaml

add `an`

Co-authored-by: Dana Hoffman <danahoffman@google.com>

* Update api.yaml

Re-ordered the sentences, providing  `when using an Internal address` is applied to all options in the field `purpose`

* Update terraform.yaml

skip_docs is applied on internal_with_shared_loadbalancer_vip

Co-authored-by: Edward Sun <sunedward@google.com>
Co-authored-by: Dana Hoffman <danahoffman@google.com>
  • Loading branch information
3 people authored Jun 18, 2020
1 parent bf7303b commit 4fc90d5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
12 changes: 12 additions & 0 deletions products/compute/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ objects:
required: true
- !ruby/object:Api::Type::Enum
name: purpose
exact_version: ga
description: |
The purpose of this resource, which can be one of the following values:

Expand All @@ -130,6 +131,17 @@ objects:
This should only be set when using an Internal address.
values:
- :GCE_ENDPOINT
- !ruby/object:Api::Type::Enum
name: purpose
exact_version: beta
description: |
The purpose of this resource, which can be one of the following values:
- GCE_ENDPOINT for addresses that are used by VM instances, alias IP ranges, internal load balancers, and similar resources.
- SHARED_LOADBALANCER_VIP for an address that can be used by multiple internal load balancers
This should only be set when using an Internal address.
values:
- :GCE_ENDPOINT
- :SHARED_LOADBALANCER_VIP
- !ruby/object:Api::Type::Enum
name: 'networkTier'
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 @@ -32,6 +32,13 @@ overrides: !ruby/object:Overrides::ResourceOverrides
primary_resource_id: "internal_with_gce_endpoint"
vars:
address_name: "my-internal-address-"
- !ruby/object:Provider::Terraform::Examples
name: "address_with_shared_loadbalancer_vip"
primary_resource_id: "internal_with_shared_loadbalancer_vip"
min_version: 'beta'
vars:
address_name: "my-internal-address"
skip_docs: true # It is almost identical to internal_with_gce_endpoint
# TODO(rileykarson): Remove this example when instance is supported
- !ruby/object:Provider::Terraform::Examples
name: "instance_with_ip"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resource "google_compute_address" "<%= ctx[:primary_resource_id] %>" {
provider = google-beta
name = "<%= ctx[:vars]['address_name'] %>"
address_type = "INTERNAL"
purpose = "SHARED_LOADBALANCER_VIP"
}

0 comments on commit 4fc90d5

Please sign in to comment.