From 0cb7099ddf8f72e3f9cc683f639d1f9321dc8c02 Mon Sep 17 00:00:00 2001 From: Alex Stephen Date: Wed, 18 Mar 2020 17:50:37 -0400 Subject: [PATCH] Ansible - All the Regional Resources (#3264) * region url map * region instance group manager * target http/https proxy * region autoscaler * revert some files * adding min_version on TF * Update products/compute/examples/ansible/region_target_https_proxy.yaml Co-Authored-By: Chris Hawk <41700375+SirGitsalot@users.noreply.github.com> Co-authored-by: Chris Hawk <41700375+SirGitsalot@users.noreply.github.com> --- products/compute/ansible.yaml | 20 - products/compute/ansible_version_added.yaml | 452 +++++++++++++++++- products/compute/api.yaml | 3 - .../examples/ansible/region_autoscaler.yaml | 79 +++ .../region_instance_group_manager.yaml | 63 +++ .../ansible/region_target_http_proxy.yaml | 66 +++ .../ansible/region_target_https_proxy.yaml | 103 ++++ .../examples/ansible/region_url_map.yaml | 48 ++ products/compute/terraform.yaml | 3 + 9 files changed, 800 insertions(+), 37 deletions(-) create mode 100644 products/compute/examples/ansible/region_autoscaler.yaml create mode 100644 products/compute/examples/ansible/region_instance_group_manager.yaml create mode 100644 products/compute/examples/ansible/region_target_http_proxy.yaml create mode 100644 products/compute/examples/ansible/region_target_https_proxy.yaml create mode 100644 products/compute/examples/ansible/region_url_map.yaml diff --git a/products/compute/ansible.yaml b/products/compute/ansible.yaml index db7cd35b17fd..427e6395f9fe 100644 --- a/products/compute/ansible.yaml +++ b/products/compute/ansible.yaml @@ -20,8 +20,6 @@ datasources: !ruby/object:Overrides::ResourceOverrides exclude: true ManagedSslCertificate: !ruby/object:Overrides::Ansible::ResourceOverride exclude: true - RegionAutoscaler: !ruby/object:Overrides::Ansible::ResourceOverride - exclude: true RegionDiskResourcePolicyAttachment: !ruby/object:Overrides::Ansible::ResourceOverride exclude: true DiskResourcePolicyAttachment: !ruby/object:Overrides::Ansible::ResourceOverride @@ -41,16 +39,8 @@ datasources: !ruby/object:Overrides::ResourceOverrides exclude: true RegionDiskType: !ruby/object:Overrides::Ansible::ResourceOverride exclude: true - RegionInstanceGroupManager: !ruby/object:Overrides::Ansible::ResourceOverride - exclude: true RegionSslCertificate: !ruby/object:Overrides::Ansible::ResourceOverride exclude: true - RegionTargetHttpProxy: !ruby/object:Overrides::Ansible::ResourceOverride - exclude: true - RegionTargetHttpsProxy: !ruby/object:Overrides::Ansible::ResourceOverride - exclude: true - RegionUrlMap: !ruby/object:Overrides::Ansible::ResourceOverride - exclude: true ResourcePolicy: !ruby/object:Overrides::Ansible::ResourceOverride exclude: true RouterBgpPeer: !ruby/object:Overrides::Ansible::ResourceOverride @@ -303,8 +293,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides TargetVpnGateway: !ruby/object:Overrides::Ansible::ResourceOverride exclude: false # Not yet implemented. - RegionAutoscaler: !ruby/object:Overrides::Ansible::ResourceOverride - exclude: true # Ansible tasks must alter infrastructure. # This means that virtual objects are a poor fit. BackendBucketSignedUrlKey: !ruby/object:Overrides::Ansible::ResourceOverride @@ -327,16 +315,8 @@ overrides: !ruby/object:Overrides::ResourceOverrides exclude: true RegionDiskType: !ruby/object:Overrides::Ansible::ResourceOverride exclude: true - RegionInstanceGroupManager: !ruby/object:Overrides::Ansible::ResourceOverride - exclude: true RegionSslCertificate: !ruby/object:Overrides::Ansible::ResourceOverride exclude: true - RegionTargetHttpProxy: !ruby/object:Overrides::Ansible::ResourceOverride - exclude: true - RegionTargetHttpsProxy: !ruby/object:Overrides::Ansible::ResourceOverride - exclude: true - RegionUrlMap: !ruby/object:Overrides::Ansible::ResourceOverride - exclude: true RouterBgpPeer: !ruby/object:Overrides::Ansible::ResourceOverride exclude: true RouterNat: !ruby/object:Overrides::Ansible::ResourceOverride diff --git a/products/compute/ansible_version_added.yaml b/products/compute/ansible_version_added.yaml index f8dfc097f3ce..a6b6a7d60226 100644 --- a/products/compute/ansible_version_added.yaml +++ b/products/compute/ansible_version_added.yaml @@ -36,6 +36,8 @@ :version_added: '2.7' :InstanceGroupManager: :version_added: '2.7' + :RegionInstanceGroupManager: + :version_added: '2.10' :InterconnectAttachment: :version_added: '2.8' :Network: @@ -46,8 +48,12 @@ :version_added: '2.10' :NodeTemplate: :version_added: '2.10' + :RegionAutoscaler: + :version_added: '2.10' :RegionDisk: :version_added: '2.8' + :RegionUrlMap: + :version_added: '2.10' :RegionHealthCheck: :version_added: '2.10' :Route: @@ -58,8 +64,6 @@ :version_added: '2.9' :SslCertificate: :version_added: '2.7' - :RegionSslCertificate: - :version_added: '2.10' :Reservation: :version_added: '2.10' :SslPolicy: @@ -70,6 +74,10 @@ :version_added: '2.7' :TargetHttpsProxy: :version_added: '2.7' + :RegionTargetHttpProxy: + :version_added: '2.10' + :RegionTargetHttpsProxy: + :version_added: '2.10' :TargetInstance: :version_added: '2.10' :TargetPool: @@ -387,6 +395,8 @@ :version_added: '2.6' :target: :version_added: '2.7' + :allowGlobalAccess: + :version_added: '2.10' :allPorts: :version_added: '2.8' :networkTier: @@ -897,6 +907,34 @@ :version_added: '2.6' :zone: :version_added: '2.6' + :RegionInstanceGroupManager: + :version_added: '2.10' + :baseInstanceName: + :version_added: '2.10' + :description: + :version_added: '2.10' + :instanceTemplate: + :version_added: '2.10' + :name: + :version_added: '2.10' + :namedPorts: + :version_added: '2.10' + :name: + :version_added: '2.10' + :port: + :version_added: '2.10' + :targetPools: + :version_added: '2.10' + :targetSize: + :version_added: '2.10' + :autoHealingPolicies: + :version_added: '2.10' + :healthCheck: + :version_added: '2.10' + :initialDelaySec: + :version_added: '2.10' + :region: + :version_added: '2.10' :InterconnectAttachment: :version_added: '2.8' :adminEnabled: @@ -979,6 +1017,44 @@ :version_added: '2.10' :region: :version_added: '2.10' + :RegionAutoscaler: + :version_added: '2.10' + :name: + :version_added: '2.10' + :description: + :version_added: '2.10' + :autoscalingPolicy: + :version_added: '2.10' + :minNumReplicas: + :version_added: '2.10' + :maxNumReplicas: + :version_added: '2.10' + :coolDownPeriodSec: + :version_added: '2.10' + :cpuUtilization: + :version_added: '2.10' + :utilizationTarget: + :version_added: '2.10' + :customMetricUtilizations: + :version_added: '2.10' + :metric: + :version_added: '2.10' + :singleInstanceAssignment: + :version_added: '2.10' + :utilizationTarget: + :version_added: '2.10' + :utilizationTargetType: + :version_added: '2.10' + :filter: + :version_added: '2.10' + :loadBalancingUtilization: + :version_added: '2.10' + :utilizationTarget: + :version_added: '2.10' + :target: + :version_added: '2.10' + :region: + :version_added: '2.10' :RegionDisk: :version_added: '2.8' :description: @@ -1013,6 +1089,344 @@ :version_added: '2.8' :kmsKeyName: :version_added: '2.8' + :RegionUrlMap: + :version_added: '2.10' + :defaultService: + :version_added: '2.10' + :description: + :version_added: '2.10' + :hostRules: + :version_added: '2.10' + :description: + :version_added: '2.10' + :hosts: + :version_added: '2.10' + :pathMatcher: + :version_added: '2.10' + :name: + :version_added: '2.10' + :pathMatchers: + :version_added: '2.10' + :defaultService: + :version_added: '2.10' + :description: + :version_added: '2.10' + :name: + :version_added: '2.10' + :routeRules: + :version_added: '2.10' + :priority: + :version_added: '2.10' + :service: + :version_added: '2.10' + :headerAction: + :version_added: '2.10' + :requestHeadersToAdd: + :version_added: '2.10' + :headerName: + :version_added: '2.10' + :headerValue: + :version_added: '2.10' + :replace: + :version_added: '2.10' + :requestHeadersToRemove: + :version_added: '2.10' + :responseHeadersToAdd: + :version_added: '2.10' + :headerName: + :version_added: '2.10' + :headerValue: + :version_added: '2.10' + :replace: + :version_added: '2.10' + :responseHeadersToRemove: + :version_added: '2.10' + :matchRules: + :version_added: '2.10' + :fullPathMatch: + :version_added: '2.10' + :headerMatches: + :version_added: '2.10' + :exactMatch: + :version_added: '2.10' + :headerName: + :version_added: '2.10' + :invertMatch: + :version_added: '2.10' + :prefixMatch: + :version_added: '2.10' + :presentMatch: + :version_added: '2.10' + :rangeMatch: + :version_added: '2.10' + :rangeEnd: + :version_added: '2.10' + :rangeStart: + :version_added: '2.10' + :regexMatch: + :version_added: '2.10' + :suffixMatch: + :version_added: '2.10' + :ignoreCase: + :version_added: '2.10' + :metadataFilters: + :version_added: '2.10' + :filterLabels: + :version_added: '2.10' + :name: + :version_added: '2.10' + :value: + :version_added: '2.10' + :filterMatchCriteria: + :version_added: '2.10' + :prefixMatch: + :version_added: '2.10' + :queryParameterMatches: + :version_added: '2.10' + :exactMatch: + :version_added: '2.10' + :name: + :version_added: '2.10' + :presentMatch: + :version_added: '2.10' + :regexMatch: + :version_added: '2.10' + :regexMatch: + :version_added: '2.10' + :routeAction: + :version_added: '2.10' + :corsPolicy: + :version_added: '2.10' + :allowCredentials: + :version_added: '2.10' + :allowHeaders: + :version_added: '2.10' + :allowMethods: + :version_added: '2.10' + :allowOriginRegexes: + :version_added: '2.10' + :allowOrigins: + :version_added: '2.10' + :disabled: + :version_added: '2.10' + :exposeHeaders: + :version_added: '2.10' + :maxAge: + :version_added: '2.10' + :faultInjectionPolicy: + :version_added: '2.10' + :abort: + :version_added: '2.10' + :httpStatus: + :version_added: '2.10' + :percentage: + :version_added: '2.10' + :delay: + :version_added: '2.10' + :fixedDelay: + :version_added: '2.10' + :nanos: + :version_added: '2.10' + :seconds: + :version_added: '2.10' + :percentage: + :version_added: '2.10' + :requestMirrorPolicy: + :version_added: '2.10' + :backendService: + :version_added: '2.10' + :retryPolicy: + :version_added: '2.10' + :numRetries: + :version_added: '2.10' + :perTryTimeout: + :version_added: '2.10' + :nanos: + :version_added: '2.10' + :seconds: + :version_added: '2.10' + :retryConditions: + :version_added: '2.10' + :timeout: + :version_added: '2.10' + :nanos: + :version_added: '2.10' + :seconds: + :version_added: '2.10' + :urlRewrite: + :version_added: '2.10' + :hostRewrite: + :version_added: '2.10' + :pathPrefixRewrite: + :version_added: '2.10' + :weightedBackendServices: + :version_added: '2.10' + :backendService: + :version_added: '2.10' + :headerAction: + :version_added: '2.10' + :requestHeadersToAdd: + :version_added: '2.10' + :headerName: + :version_added: '2.10' + :headerValue: + :version_added: '2.10' + :replace: + :version_added: '2.10' + :requestHeadersToRemove: + :version_added: '2.10' + :responseHeadersToAdd: + :version_added: '2.10' + :headerName: + :version_added: '2.10' + :headerValue: + :version_added: '2.10' + :replace: + :version_added: '2.10' + :responseHeadersToRemove: + :version_added: '2.10' + :weight: + :version_added: '2.10' + :urlRedirect: + :version_added: '2.10' + :hostRedirect: + :version_added: '2.10' + :httpsRedirect: + :version_added: '2.10' + :pathRedirect: + :version_added: '2.10' + :prefixRedirect: + :version_added: '2.10' + :redirectResponseCode: + :version_added: '2.10' + :stripQuery: + :version_added: '2.10' + :pathRules: + :version_added: '2.10' + :service: + :version_added: '2.10' + :paths: + :version_added: '2.10' + :routeAction: + :version_added: '2.10' + :corsPolicy: + :version_added: '2.10' + :allowCredentials: + :version_added: '2.10' + :allowHeaders: + :version_added: '2.10' + :allowMethods: + :version_added: '2.10' + :allowOriginRegexes: + :version_added: '2.10' + :allowOrigins: + :version_added: '2.10' + :disabled: + :version_added: '2.10' + :exposeHeaders: + :version_added: '2.10' + :maxAge: + :version_added: '2.10' + :faultInjectionPolicy: + :version_added: '2.10' + :abort: + :version_added: '2.10' + :httpStatus: + :version_added: '2.10' + :percentage: + :version_added: '2.10' + :delay: + :version_added: '2.10' + :fixedDelay: + :version_added: '2.10' + :nanos: + :version_added: '2.10' + :seconds: + :version_added: '2.10' + :percentage: + :version_added: '2.10' + :requestMirrorPolicy: + :version_added: '2.10' + :backendService: + :version_added: '2.10' + :retryPolicy: + :version_added: '2.10' + :numRetries: + :version_added: '2.10' + :perTryTimeout: + :version_added: '2.10' + :nanos: + :version_added: '2.10' + :seconds: + :version_added: '2.10' + :retryConditions: + :version_added: '2.10' + :timeout: + :version_added: '2.10' + :nanos: + :version_added: '2.10' + :seconds: + :version_added: '2.10' + :urlRewrite: + :version_added: '2.10' + :hostRewrite: + :version_added: '2.10' + :pathPrefixRewrite: + :version_added: '2.10' + :weightedBackendServices: + :version_added: '2.10' + :backendService: + :version_added: '2.10' + :headerAction: + :version_added: '2.10' + :requestHeadersToAdd: + :version_added: '2.10' + :headerName: + :version_added: '2.10' + :headerValue: + :version_added: '2.10' + :replace: + :version_added: '2.10' + :requestHeadersToRemove: + :version_added: '2.10' + :responseHeadersToAdd: + :version_added: '2.10' + :headerName: + :version_added: '2.10' + :headerValue: + :version_added: '2.10' + :replace: + :version_added: '2.10' + :responseHeadersToRemove: + :version_added: '2.10' + :weight: + :version_added: '2.10' + :urlRedirect: + :version_added: '2.10' + :hostRedirect: + :version_added: '2.10' + :httpsRedirect: + :version_added: '2.10' + :pathRedirect: + :version_added: '2.10' + :prefixRedirect: + :version_added: '2.10' + :redirectResponseCode: + :version_added: '2.10' + :stripQuery: + :version_added: '2.10' + :tests: + :version_added: '2.10' + :description: + :version_added: '2.10' + :host: + :version_added: '2.10' + :path: + :version_added: '2.10' + :service: + :version_added: '2.10' + :region: + :version_added: '2.10' :RegionHealthCheck: :version_added: '2.10' :checkIntervalSec: @@ -1189,18 +1603,6 @@ :version_added: '2.6' :privateKey: :version_added: '2.6' - :RegionSslCertificate: - :version_added: '2.10' - :certificate: - :version_added: '2.10' - :description: - :version_added: '2.10' - :name: - :version_added: '2.10' - :privateKey: - :version_added: '2.10' - :region: - :version_added: '2.10' :Reservation: :version_added: '2.10' :description: @@ -1287,6 +1689,28 @@ :version_added: '2.8' :urlMap: :version_added: '2.6' + :RegionTargetHttpProxy: + :version_added: '2.10' + :description: + :version_added: '2.10' + :name: + :version_added: '2.10' + :urlMap: + :version_added: '2.10' + :region: + :version_added: '2.10' + :RegionTargetHttpsProxy: + :version_added: '2.10' + :description: + :version_added: '2.10' + :name: + :version_added: '2.10' + :sslCertificates: + :version_added: '2.10' + :urlMap: + :version_added: '2.10' + :region: + :version_added: '2.10' :TargetInstance: :version_added: '2.10' :name: diff --git a/products/compute/api.yaml b/products/compute/api.yaml index 2cba2b1d0204..1bbe0d77cd5b 100644 --- a/products/compute/api.yaml +++ b/products/compute/api.yaml @@ -8473,7 +8473,6 @@ objects: create the disk. Provide this when creating the disk. - !ruby/object:Api::Resource name: 'RegionUrlMap' - min_version: 'beta' kind: 'compute#urlMap' base_url: projects/{{project}}/regions/{{region}}/urlMaps collection_url_key: 'items' @@ -12443,7 +12442,6 @@ objects: update_url: 'projects/{{project}}/targetHttpsProxies/{{name}}/setUrlMap' - !ruby/object:Api::Resource name: 'RegionTargetHttpProxy' - min_version: beta kind: 'compute#targetHttpProxy' base_url: projects/{{project}}/regions/{{region}}/targetHttpProxies collection_url_key: 'items' @@ -12519,7 +12517,6 @@ objects: update_url: 'projects/{{project}}/regions/{{region}}/targetHttpProxies/{{name}}/setUrlMap' - !ruby/object:Api::Resource name: 'RegionTargetHttpsProxy' - min_version: beta kind: 'compute#targetHttpsProxy' base_url: projects/{{project}}/regions/{{region}}/targetHttpsProxies collection_url_key: 'items' diff --git a/products/compute/examples/ansible/region_autoscaler.yaml b/products/compute/examples/ansible/region_autoscaler.yaml new file mode 100644 index 000000000000..fdbcdf3f3203 --- /dev/null +++ b/products/compute/examples/ansible/region_autoscaler.yaml @@ -0,0 +1,79 @@ +# Copyright 2017 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:Provider::Ansible::Example +dependencies: + - !ruby/object:Provider::Ansible::Task + name: gcp_compute_network + register: network + code: + name: <%= dependency_name('network', 'instanceTemplate') %> + project: <%= ctx[:project] %> + auth_kind: <%= ctx[:auth_kind] %> + service_account_file: <%= ctx[:service_account_file] %> + - !ruby/object:Provider::Ansible::Task + name: gcp_compute_address + register: address + code: + name: <%= dependency_name('address', 'instanceTemplate') %> + region: 'us-central1' + project: <%= ctx[:project] %> + auth_kind: <%= ctx[:auth_kind] %> + service_account_file: <%= ctx[:service_account_file] %> + - !ruby/object:Provider::Ansible::Task + name: gcp_compute_instance_template + register: instancetemplate + code: + name: <%= ctx[:name] %> + properties: + disks: + - auto_delete: true + boot: true + initialize_params: + source_image: 'projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts' + machine_type: n1-standard-1 + network_interfaces: + - network: "{{ network }}" + access_configs: + - name: 'test-config' + type: 'ONE_TO_ONE_NAT' + nat_ip: "{{ address }}" + project: <%= ctx[:project] %> + auth_kind: <%= ctx[:auth_kind] %> + service_account_file: <%= ctx[:service_account_file] %> + - !ruby/object:Provider::Ansible::Task + name: gcp_compute_region_instance_group_manager + code: + name: <%= ctx[:name] %> + base_instance_name: 'test1-child' + region: "us-central1" + instance_template: "{{ instancetemplate }}" + target_size: 3 + project: <%= ctx[:project] %> + auth_kind: <%= ctx[:auth_kind] %> + service_account_file: <%= ctx[:service_account_file] %> + register: igrm +task: !ruby/object:Provider::Ansible::Task + name: gcp_compute_region_autoscaler + code: + name: "my-region-autoscaler" + region: us-central1 + autoscaling_policy: + min_num_replicas: 1 + max_num_replicas: 5 + cool_down_period_sec: 60 + cpu_utilization: + utilization_target: 0.5 + target: "{{igrm.selfLink}}" + project: <%= ctx[:project] %> + auth_kind: <%= ctx[:auth_kind] %> + service_account_file: <%= ctx[:service_account_file] %> diff --git a/products/compute/examples/ansible/region_instance_group_manager.yaml b/products/compute/examples/ansible/region_instance_group_manager.yaml new file mode 100644 index 000000000000..14b1a6e31b5a --- /dev/null +++ b/products/compute/examples/ansible/region_instance_group_manager.yaml @@ -0,0 +1,63 @@ +# Copyright 2017 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:Provider::Ansible::Example +dependencies: + - !ruby/object:Provider::Ansible::Task + name: gcp_compute_network + register: network + code: + name: <%= dependency_name('network', 'instanceTemplate') %> + project: <%= ctx[:project] %> + auth_kind: <%= ctx[:auth_kind] %> + service_account_file: <%= ctx[:service_account_file] %> + - !ruby/object:Provider::Ansible::Task + name: gcp_compute_address + register: address + code: + name: <%= dependency_name('address', 'instanceTemplate') %> + region: 'us-central1' + project: <%= ctx[:project] %> + auth_kind: <%= ctx[:auth_kind] %> + service_account_file: <%= ctx[:service_account_file] %> + - !ruby/object:Provider::Ansible::Task + name: gcp_compute_instance_template + register: instancetemplate + code: + name: <%= ctx[:name] %> + properties: + disks: + - auto_delete: true + boot: true + initialize_params: + source_image: 'projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts' + machine_type: n1-standard-1 + network_interfaces: + - network: "{{ network }}" + access_configs: + - name: 'test-config' + type: 'ONE_TO_ONE_NAT' + nat_ip: "{{ address }}" + project: <%= ctx[:project] %> + auth_kind: <%= ctx[:auth_kind] %> + service_account_file: <%= ctx[:service_account_file] %> +task: !ruby/object:Provider::Ansible::Task + name: gcp_compute_region_instance_group_manager + code: + name: <%= ctx[:name] %> + base_instance_name: 'test1-child' + region: "us-central1" + instance_template: "{{ instancetemplate }}" + target_size: 3 + project: <%= ctx[:project] %> + auth_kind: <%= ctx[:auth_kind] %> + service_account_file: <%= ctx[:service_account_file] %> diff --git a/products/compute/examples/ansible/region_target_http_proxy.yaml b/products/compute/examples/ansible/region_target_http_proxy.yaml new file mode 100644 index 000000000000..48d8a886732f --- /dev/null +++ b/products/compute/examples/ansible/region_target_http_proxy.yaml @@ -0,0 +1,66 @@ +# Copyright 2017 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:Provider::Ansible::Example +dependencies: + - !ruby/object:Provider::Ansible::Task + name: gcp_compute_instance_group + register: instancegroup + code: + name: <%= dependency_name('instanceGroup', 'targetHttpProxy') %> + zone: 'us-central1-a' + project: <%= ctx[:project] %> + auth_kind: <%= ctx[:auth_kind] %> + service_account_file: <%= ctx[:service_account_file] %> + - !ruby/object:Provider::Ansible::Task + name: gcp_compute_http_health_check + register: healthcheck + code: + name: <%= dependency_name('httpHealthCheck', 'targetHttpProxy') %> + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: <%= ctx[:project] %> + auth_kind: <%= ctx[:auth_kind] %> + service_account_file: <%= ctx[:service_account_file] %> + - !ruby/object:Provider::Ansible::Task + name: gcp_compute_backend_service + register: backendservice + code: + name: <%= dependency_name('backendService', 'targetHttpProxy') %> + backends: + - group: "{{ instancegroup.selfLink }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: true + project: <%= ctx[:project] %> + auth_kind: <%= ctx[:auth_kind] %> + service_account_file: <%= ctx[:service_account_file] %> + - !ruby/object:Provider::Ansible::Task + name: gcp_compute_url_map + register: urlmap + code: + name: <%= dependency_name('urlMap', 'targetHttpProxy') %> + default_service: "{{ backendservice }}" + project: <%= ctx[:project] %> + auth_kind: <%= ctx[:auth_kind] %> + service_account_file: <%= ctx[:service_account_file] %> +task: !ruby/object:Provider::Ansible::Task + name: gcp_compute_region_target_http_proxy + code: + name: <%= ctx[:name] %> + region: "us-central1" + url_map: "{{ urlmap }}" + project: <%= ctx[:project] %> + auth_kind: <%= ctx[:auth_kind] %> + service_account_file: <%= ctx[:service_account_file] %> diff --git a/products/compute/examples/ansible/region_target_https_proxy.yaml b/products/compute/examples/ansible/region_target_https_proxy.yaml new file mode 100644 index 000000000000..b4e2aff38793 --- /dev/null +++ b/products/compute/examples/ansible/region_target_https_proxy.yaml @@ -0,0 +1,103 @@ +# Copyright 2020 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:Provider::Ansible::Example +dependencies: + - !ruby/object:Provider::Ansible::Task + name: gcp_compute_instance_group + register: instancegroup + code: + name: <%= dependency_name('instanceGroup', 'targetHttpsProxy') %> + zone: 'us-central1-a' + project: <%= ctx[:project] %> + auth_kind: <%= ctx[:auth_kind] %> + service_account_file: <%= ctx[:service_account_file] %> + - !ruby/object:Provider::Ansible::Task + name: gcp_compute_region_health_check + register: healthcheck + code: + name: <%= ctx[:name] %> + type: HTTPS + healthy_threshold: 10 + timeout_sec: 2 + unhealthy_threshold: 5 + region: 'us-central1' + project: <%= ctx[:project] %> + auth_kind: <%= ctx[:auth_kind] %> + service_account_file: <%= ctx[:service_account_file] %> + - !ruby/object:Provider::Ansible::Task + name: gcp_compute_region_backend_service + register: backendservice + code: + name: <%= dependency_name('backendService', 'targetHttpsProxy') %> + region: "us-central1" + backends: + - group: "{{ instancegroup.selfLink }}" + healthchecks: + - "{{ healthcheck.selfLink }}" + project: <%= ctx[:project] %> + auth_kind: <%= ctx[:auth_kind] %> + service_account_file: <%= ctx[:service_account_file] %> + - !ruby/object:Provider::Ansible::Task + name: gcp_compute_region_url_map + register: urlmap + code: + name: <%= dependency_name('urlMap', 'targetHttpsProxy') %> + region: "us-central1" + default_service: "{{ backendservice }}" + project: <%= ctx[:project] %> + auth_kind: <%= ctx[:auth_kind] %> + service_account_file: <%= ctx[:service_account_file] %> + - !ruby/object:Provider::Ansible::Task + name: gcp_compute_ssl_certificate + register: sslcert + code: + name: <%= dependency_name('sslCert', 'targetHttpsProxy') %> + description: A certificate for testing. Do not use this certificate in production + certificate: | + -----BEGIN CERTIFICATE----- + MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG + EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT + BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm + b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN + AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 + MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP + BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM + FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z + aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH + KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ + 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O + BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn + 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O + M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ + zqGNhIPGq2ULqXKK8BY= + -----END CERTIFICATE----- + private_key: | + -----BEGIN EC PRIVATE KEY----- + MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 + AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f + OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== + -----END EC PRIVATE KEY----- + project: <%= ctx[:project] %> + auth_kind: <%= ctx[:auth_kind] %> + service_account_file: <%= ctx[:service_account_file] %> +task: !ruby/object:Provider::Ansible::Task + name: gcp_compute_region_target_https_proxy + code: + name: <%= ctx[:name] %> + region: "us-central1" + ssl_certificates: + - "{{ sslcert }}" + url_map: "{{ urlmap }}" + project: <%= ctx[:project] %> + auth_kind: <%= ctx[:auth_kind] %> + service_account_file: <%= ctx[:service_account_file] %> diff --git a/products/compute/examples/ansible/region_url_map.yaml b/products/compute/examples/ansible/region_url_map.yaml new file mode 100644 index 000000000000..2a22f838a84f --- /dev/null +++ b/products/compute/examples/ansible/region_url_map.yaml @@ -0,0 +1,48 @@ +# Copyright 2017 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:Provider::Ansible::Example +dependencies: + - !ruby/object:Provider::Ansible::Task + name: gcp_compute_health_check + code: + name: <%= ctx[:name] %> + type: HTTP + http_health_check: + port: 80 + check_interval_sec: 1 + timeout_sec: 1 + project: <%= ctx[:project] %> + auth_kind: <%= ctx[:auth_kind] %> + service_account_file: <%= ctx[:service_account_file] %> + register: healthcheck + - !ruby/object:Provider::Ansible::Task + name: gcp_compute_region_backend_service + code: + name: <%= ctx[:name] %> + region: us-central1 + health_checks: + - "{{ healthcheck.selfLink }}" + protocol: "HTTP" + project: <%= ctx[:project] %> + auth_kind: <%= ctx[:auth_kind] %> + service_account_file: <%= ctx[:service_account_file] %> + register: backendservice +task: !ruby/object:Provider::Ansible::Task + name: gcp_compute_region_url_map + code: + name: <%= ctx[:name] %> + region: 'us-central1' + default_service: "{{ backendservice }}" + project: <%= ctx[:project] %> + auth_kind: <%= ctx[:auth_kind] %> + service_account_file: <%= ctx[:service_account_file] %> diff --git a/products/compute/terraform.yaml b/products/compute/terraform.yaml index 2d2d506c7da3..97812643e0bb 100644 --- a/products/compute/terraform.yaml +++ b/products/compute/terraform.yaml @@ -1379,6 +1379,7 @@ overrides: !ruby/object:Overrides::ResourceOverrides sslHealthCheck: !ruby/object:Overrides::Terraform::PropertyOverride diff_suppress_func: 'portDiffSuppress' RegionUrlMap: !ruby/object:Overrides::Terraform::ResourceOverride + min_version: 'beta' examples: - !ruby/object:Provider::Terraform::Examples name: "region_url_map_basic" @@ -1994,6 +1995,7 @@ overrides: !ruby/object:Overrides::ResourceOverrides default_value: :NONE custom_flatten: 'templates/terraform/custom_flatten/default_if_empty.erb' RegionTargetHttpProxy: !ruby/object:Overrides::Terraform::ResourceOverride + min_version: 'beta' examples: - !ruby/object:Provider::Terraform::Examples name: "region_target_http_proxy_basic" @@ -2014,6 +2016,7 @@ overrides: !ruby/object:Overrides::ResourceOverrides id: !ruby/object:Overrides::Terraform::PropertyOverride name: proxyId RegionTargetHttpsProxy: !ruby/object:Overrides::Terraform::ResourceOverride + min_version: 'beta' examples: - !ruby/object:Provider::Terraform::Examples name: "region_target_https_proxy_basic"