google/resource-snippets/compute-v1/global_forwarding_rule.jinja (75 lines of code) (raw):

# Copyright 2018 Google Inc. All rights reserved. # # 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. {% set GLOBALFWDRULE = "g-fwd-rule-" + env["deployment"] %} {% set HEALTHCHECK = "health-check-" + env["deployment"] %} {% set BS1 = "bs1-" + env["deployment"] %} {% set BS2 = "bs2-" + env["deployment"] %} {% set URLMAP = "url-map-" + env["deployment"] %} {% set TARGET = "target-" + env["deployment"] %} resources: - type: gcp-types/compute-v1:globalForwardingRules name: {{ GLOBALFWDRULE }} properties: region: {{ properties["region"] }} IPProtocol: TCP IPAddress: 127.0.0.1 portRange: 80 target: $(ref.{{ TARGET }}.selfLink) loadBalancingScheme: INTERNAL_SELF_MANAGED - type: gcp-types/compute-v1:healthChecks name: {{ HEALTHCHECK }} properties: type: TCP tcpHealthCheck: portName: test-port port: 8080 - type: gcp-types/compute-v1:backendServices name: {{ BS1 }} properties: description: backend service for integration tests healthChecks: - $(ref.{{ HEALTHCHECK }}.selfLink) port: 80 portName: http protocol: HTTP timeoutSec: 30 loadBalancingScheme: INTERNAL_SELF_MANAGED - type: gcp-types/compute-v1:backendServices name: {{ BS2 }} properties: description: backend service for integration tests healthChecks: - $(ref.{{ HEALTHCHECK }}.selfLink) port: 80 portName: http protocol: HTTP timeoutSec: 30 loadBalancingScheme: INTERNAL_SELF_MANAGED - type: gcp-types/compute-v1:urlMaps name: {{ URLMAP }} properties: pathMatchers: - defaultService: $(ref.{{ BS1 }}.selfLink) description: '' name: url-set-1-{{ env["deployment"] }} defaultService: $(ref.{{ BS2 }}.selfLink) hostRules: - description: 'test host rule' hosts: - '*' pathMatcher: url-set-1-{{ env["deployment"] }} - type: gcp-types/compute-v1:targetHttpProxies name: {{ TARGET }} properties: urlMap: $(ref.{{ URLMAP }}.selfLink)