Skip to content

Commit

Permalink
Add purpose field to google compute address (#2284)
Browse files Browse the repository at this point in the history
Merged PR #2284.
  • Loading branch information
megan07 authored and modular-magician committed Sep 4, 2019
1 parent 3212fb4 commit f134ee8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
10 changes: 10 additions & 0 deletions products/compute/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,16 @@ objects:
following characters must be a dash, lowercase letter, or digit,
except the last character, which cannot be a dash.
required: true
- !ruby/object:Api::Type::Enum
name: purpose
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.
This should only be set when using an Internal address.
values:
- :GCE_ENDPOINT
- !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 @@ -28,6 +28,11 @@ overrides: !ruby/object:Overrides::ResourceOverrides
address_name: "my-internal-address"
network_name: "my-network"
subnetwork_name: "my-subnet"
- !ruby/object:Provider::Terraform::Examples
name: "address_with_gce_endpoint"
primary_resource_id: "internal_with_gce_endpoint"
vars:
address_name: "my-internal-address-"
# TODO(rileykarson): Remove this example when instance is supported
- !ruby/object:Provider::Terraform::Examples
name: "instance_with_ip"
Expand All @@ -40,6 +45,8 @@ overrides: !ruby/object:Overrides::ResourceOverrides
default_from_api: true
addressType: !ruby/object:Overrides::Terraform::PropertyOverride
custom_flatten: 'templates/terraform/custom_flatten/default_if_empty.erb'
purpose: !ruby/object:Overrides::Terraform::PropertyOverride
default_from_api: true
id: !ruby/object:Overrides::Terraform::PropertyOverride
exclude: true
labelFingerprint: !ruby/object:Overrides::Terraform::PropertyOverride
Expand Down
5 changes: 5 additions & 0 deletions templates/terraform/examples/address_with_gce_endpoint.tf.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resource "google_compute_address" "<%= ctx[:primary_resource_id] %>" {
name = "<%= ctx[:vars]['address_name'] %>"
address_type = "INTERNAL"
purpose = "GCE_ENDPOINT"
}

0 comments on commit f134ee8

Please sign in to comment.