diff --git a/docs/resources/google_compute_region_backend_service.md b/docs/resources/google_compute_region_backend_service.md index c1a53592b..6cd605103 100644 --- a/docs/resources/google_compute_region_backend_service.md +++ b/docs/resources/google_compute_region_backend_service.md @@ -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 diff --git a/docs/resources/google_compute_region_backend_services.md b/docs/resources/google_compute_region_backend_services.md index f901fd916..11907b847 100644 --- a/docs/resources/google_compute_region_backend_services.md +++ b/docs/resources/google_compute_region_backend_services.md @@ -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 diff --git a/libraries/google_compute_region_backend_service.rb b/libraries/google_compute_region_backend_service.rb index 5bcdd1b68..401a7b239 100644 --- a/libraries/google_compute_region_backend_service.rb +++ b/libraries/google_compute_region_backend_service.rb @@ -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 @@ -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'] diff --git a/libraries/google_compute_region_backend_services.rb b/libraries/google_compute_region_backend_services.rb index ce67fac95..d19f5a273 100644 --- a/libraries/google_compute_region_backend_services.rb +++ b/libraries/google_compute_region_backend_services.rb @@ -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) @@ -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'] },