Skip to content

Commit

Permalink
Add lb traffic extension resource (GoogleCloudPlatform#10121)
Browse files Browse the repository at this point in the history
Co-authored-by: pweiber <[email protected]>
  • Loading branch information
2 people authored and Cheriit committed Jun 4, 2024
1 parent 79a7aec commit 47e1916
Show file tree
Hide file tree
Showing 3 changed files with 1,323 additions and 0 deletions.
185 changes: 185 additions & 0 deletions mmv1/products/networkservices/LbTrafficExtension.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
# Copyright 2024 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

--- !ruby/object:Api::Resource
name: 'LbTrafficExtension'
description: |
LbTrafficExtension is a resource that lets the extension service modify the headers and payloads of both requests and responses without impacting the choice of backend services or any other security policies associated with the backend service.
references: !ruby/object:Api::Resource::ReferenceLinks
guides:
'Configure a traffic extension': 'https://cloud.google.com/service-extensions/docs/configure-callout#configure_a_traffic_extension'
api: 'https://cloud.google.com/service-extensions/docs/reference/rest/v1beta1/projects.locations.lbTrafficExtensions'
base_url: 'projects/{{project}}/locations/{{location}}/lbTrafficExtensions'
self_link: 'projects/{{project}}/locations/{{location}}/lbTrafficExtensions/{{name}}'
timeouts: !ruby/object:Api::Timeouts
insert_minutes: 20
update_minutes: 20
delete_minutes: 20
create_url: 'projects/{{project}}/locations/{{location}}/lbTrafficExtensions?lbTrafficExtensionId={{name}}'
update_verb: :PATCH
update_mask: true
autogen_async: true
async: !ruby/object:Api::OpAsync
operation: !ruby/object:Api::OpAsync::Operation
base_url: '{{op_id}}'
examples:
- !ruby/object:Provider::Terraform::Examples
name: 'network_services_lb_traffic_extension_basic'
primary_resource_id: 'default'
vars:
ilb_network_name: 'l7-ilb-network'
proxy_subnet_name: 'l7-ilb-proxy-subnet'
backend_subnet_name: 'l7-ilb-subnet'
forwarding_rule_name: 'l7-ilb-forwarding-rule'
target_http_proxy_name: 'l7-ilb-target-http-proxy'
regional_url_map_name: 'l7-ilb-regional-url-map'
backend_service_name: 'l7-ilb-backend-subnet'
mig_template_name: 'l7-ilb-mig-template'
hc_name: 'l7-ilb-hc'
mig_name: 'l7-ilb-mig1'
fw_allow_iap_hc_name: 'l7-ilb-fw-allow-iap-hc'
fw_allow_ilb_to_backends_name: 'l7-ilb-fw-allow-ilb-to-backends'
vm_test_name: 'l7-ilb-test-vm'
lb_traffic_extension_name: 'l7-ilb-traffic-ext'
callouts_instance_name: 'l7-ilb-callouts-ins'
callouts_instance_group: 'l7-ilb-callouts-ins-group'
callouts_hc_name: 'l7-ilb-callouts-hc'
callouts_backend_name: 'l7-ilb-callouts-backend'
parameters:
- !ruby/object:Api::Type::String
name: 'location'
required: true
immutable: true
url_param_only: true
description: |
The location of the traffic extension
- !ruby/object:Api::Type::String
name: 'name'
required: true
immutable: true
url_param_only: true
description: |
Name of the LbTrafficExtension resource in the following format: projects/{project}/locations/{location}/lbTrafficExtensions/{lbTrafficExtension}.
properties:
- !ruby/object:Api::Type::String
name: 'description'
description: |
A human-readable description of the resource.
- !ruby/object:Api::Type::KeyValueLabels
name: 'labels'
description: 'Set of labels associated with the LbTrafficExtension resource.'
- !ruby/object:Api::Type::Array
name: forwardingRules
description: |
A list of references to the forwarding rules to which this service extension is attached to.
At least one forwarding rule is required. There can be only one LBTrafficExtension resource per forwarding rule.
required: true
item_type: Api::Type::String
diff_suppress_func: 'tpgresource.ProjectNumberDiffSuppress'
- !ruby/object:Api::Type::Array
name: extensionChains
description: |
A set of ordered extension chains that contain the match conditions and extensions to execute.
Match conditions for each extension chain are evaluated in sequence for a given request.
The first extension chain that has a condition that matches the request is executed.
Any subsequent extension chains do not execute. Limited to 5 extension chains per resource.
required: true
item_type: !ruby/object:Api::Type::NestedObject
properties:
- !ruby/object:Api::Type::String
name: 'name'
description: |
The name for this extension chain. The name is logged as part of the HTTP request logs.
The name must conform with RFC-1034, is restricted to lower-cased letters, numbers and hyphens,
and can have a maximum length of 63 characters. Additionally, the first character must be a letter
and the last a letter or a number.
required: true
- !ruby/object:Api::Type::NestedObject
name: 'matchCondition'
description: |
Conditions under which this chain is invoked for a request.
required: true
properties:
- !ruby/object:Api::Type::String
name: 'celExpression'
description: |
A Common Expression Language (CEL) expression that is used to match requests for which the extension chain is executed.
required: true
- !ruby/object:Api::Type::Array
name: 'extensions'
description: |
A set of extensions to execute for the matching request.
At least one extension is required. Up to 3 extensions can be defined for each extension chain for
LbTrafficExtension resource. LbRouteExtension chains are limited to 1 extension per extension chain.
required: true
item_type: !ruby/object:Api::Type::NestedObject
properties:
- !ruby/object:Api::Type::String
name: 'name'
description: |
The name for this extension. The name is logged as part of the HTTP request logs.
The name must conform with RFC-1034, is restricted to lower-cased letters, numbers and hyphens,
and can have a maximum length of 63 characters. Additionally, the first character must be a letter
and the last a letter or a number.
required: true
- !ruby/object:Api::Type::String
name: 'authority'
description: |
The :authority header in the gRPC request sent from Envoy to the extension service.
required: true
- !ruby/object:Api::Type::String
name: 'service'
description: |
The reference to the service that runs the extension. Must be a reference to a backend service
required: true
diff_suppress_func: 'tpgresource.ProjectNumberDiffSuppress'
- !ruby/object:Api::Type::String
name: 'timeout'
description: |
Specifies the timeout for each individual message on the stream. The timeout must be between 10-1000 milliseconds.
A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".
required: true
diff_suppress_func: 'tpgresource.DurationDiffSuppress'
- !ruby/object:Api::Type::Boolean
name: 'failOpen'
description: |
Determines how the proxy behaves if the call to the extension fails or times out.
When set to TRUE, request or response processing continues without error.
Any subsequent extensions in the extension chain are also executed.
When set to FALSE: * If response headers have not been delivered to the downstream client,
a generic 500 error is returned to the client. The error response can be tailored by
configuring a custom error response in the load balancer.
- !ruby/object:Api::Type::Array
name: 'forwardHeaders'
description: |
List of the HTTP headers to forward to the extension (from the client or backend).
If omitted, all headers are sent. Each element is a string indicating the header name.
item_type: Api::Type::String
- !ruby/object:Api::Type::Array
name: 'supportedEvents'
min_size: 1
description: |
A set of events during request or response processing for which this extension is called.
This field is required for the LbTrafficExtension resource. It's not relevant for the LbRouteExtension
resource. Possible values:`EVENT_TYPE_UNSPECIFIED`, `REQUEST_HEADERS`, `REQUEST_BODY`, `RESPONSE_HEADERS`,
`RESPONSE_BODY`, `RESPONSE_BODY` and `RESPONSE_BODY`.
item_type: Api::Type::String
- !ruby/object:Api::Type::Enum
name: 'loadBalancingScheme'
description: |
All backend services and forwarding rules referenced by this extension must share the same load balancing scheme.
For more information, refer to Choosing a load balancer.
values:
- :LOAD_BALANCING_SCHEME_UNSPECIFIED
- :INTERNAL_MANAGED
- :EXTERNAL_MANAGED
Loading

0 comments on commit 47e1916

Please sign in to comment.