Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add region_backend_service portName #396

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/resources/google_compute_region_backend_service.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ Properties that can be accessed from the `google_compute_region_backend_service`

* `success_rate_stdev_factor`: This factor is used to determine the ejection threshold for success rate outlier ejection. The ejection threshold is the difference between the mean success rate, and the product of this factor and the standard deviation of the mean success rate: mean - (stdev * success_rate_stdev_factor). This factor is divided by a thousand to get a double. That is, if the desired factor is 1.9, the runtime value should be 1900. Defaults to 1900.

* `port_name`: A named port on a backend instance group representing the port for communication to the backend VMs in that group. Required when the loadBalancingScheme is EXTERNAL, INTERNAL_MANAGED, or INTERNAL_SELF_MANAGED and the backends are instance groups. The named port must be defined on each backend instance group. This parameter has no meaning if the backends are NEGs. API sets a default of "http" if not given. Must be omitted when the loadBalancingScheme is INTERNAL (Internal TCP/UDP Load Balancing).

* `protocol`: The protocol this RegionBackendService uses to communicate with backends. The default is HTTP. **NOTE**: HTTP2 is only valid for beta HTTP/2 load balancer types and may result in errors if used with the GA API.
Possible values:
* HTTP
Expand Down
1 change: 1 addition & 0 deletions docs/resources/google_compute_region_backend_services.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ See [google_compute_region_backend_service.md](google_compute_region_backend_ser
* `locality_lb_policies`: an array of `google_compute_region_backend_service` locality_lb_policy
* `names`: an array of `google_compute_region_backend_service` name
* `outlier_detections`: an array of `google_compute_region_backend_service` outlier_detection
* `port_names`: an array of `google_compute_region_backend_service` port_name
* `protocols`: an array of `google_compute_region_backend_service` protocol
* `session_affinities`: an array of `google_compute_region_backend_service` session_affinity
* `timeout_secs`: an array of `google_compute_region_backend_service` timeout_sec
Expand Down
2 changes: 2 additions & 0 deletions libraries/google_compute_region_backend_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class ComputeRegionBackendService < GcpResourceBase
attr_reader :locality_lb_policy
attr_reader :name
attr_reader :outlier_detection
attr_reader :port_name
attr_reader :protocol
attr_reader :session_affinity
attr_reader :timeout_sec
Expand Down Expand Up @@ -79,6 +80,7 @@ def parse
@locality_lb_policy = @fetched['localityLbPolicy']
@name = @fetched['name']
@outlier_detection = GoogleInSpec::Compute::Property::RegionBackendServiceOutlierDetection.new(@fetched['outlierDetection'], to_s)
@port_name = @fetched['portName']
@protocol = @fetched['protocol']
@session_affinity = @fetched['sessionAffinity']
@timeout_sec = @fetched['timeoutSec']
Expand Down
2 changes: 2 additions & 0 deletions libraries/google_compute_region_backend_services.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class ComputeRegionBackendServices < GcpResourceBase
filter_table_config.add(:locality_lb_policies, field: :locality_lb_policy)
filter_table_config.add(:names, field: :name)
filter_table_config.add(:outlier_detections, field: :outlier_detection)
filter_table_config.add(:port_names, field: :port_name)
filter_table_config.add(:protocols, field: :protocol)
filter_table_config.add(:session_affinities, field: :session_affinity)
filter_table_config.add(:timeout_secs, field: :timeout_sec)
Expand Down Expand Up @@ -98,6 +99,7 @@ def transformers
'localityLbPolicy' => ->(obj) { return :locality_lb_policy, obj['localityLbPolicy'] },
'name' => ->(obj) { return :name, obj['name'] },
'outlierDetection' => ->(obj) { return :outlier_detection, GoogleInSpec::Compute::Property::RegionBackendServiceOutlierDetection.new(obj['outlierDetection'], to_s) },
'portName' => ->(obj) { return :port_name, obj['portName'] },
'protocol' => ->(obj) { return :protocol, obj['protocol'] },
'sessionAffinity' => ->(obj) { return :session_affinity, obj['sessionAffinity'] },
'timeoutSec' => ->(obj) { return :timeout_sec, obj['timeoutSec'] },
Expand Down