diff --git a/Gemfile b/Gemfile index cfc74848c..53e84ee64 100644 --- a/Gemfile +++ b/Gemfile @@ -7,7 +7,7 @@ gem 'google-cloud' gem 'googleauth' gem 'inifile' gem 'inspec-bin', '4.16.0' -gem 'rubocop', '>= 0.70.0' +gem 'rubocop' group :development do gem 'github_changelog_generator' diff --git a/docs/resources/google_compute_route.md b/docs/resources/google_compute_route.md index 69091bb80..4c55bd74c 100644 --- a/docs/resources/google_compute_route.md +++ b/docs/resources/google_compute_route.md @@ -47,6 +47,8 @@ Properties that can be accessed from the `google_compute_route` resource: * `next_hop_network`: URL to a Network that should handle matching packets. + * `next_hop_ilb`: The URL to a forwarding rule of type loadBalancingScheme=INTERNAL that should handle matching packets. You can only specify the forwarding rule as a partial or full URL. For example, the following are all valid URLs: https://www.googleapis.com/compute/v1/projects/project/regions/region/forwardingRules/forwardingRule regions/region/forwardingRules/forwardingRule Note that this can only be used when the destinationRange is a public (non-RFC 1918) IP CIDR range. + ## GCP Permissions diff --git a/docs/resources/google_compute_routes.md b/docs/resources/google_compute_routes.md index 631694fbb..8097a96f8 100644 --- a/docs/resources/google_compute_routes.md +++ b/docs/resources/google_compute_routes.md @@ -31,6 +31,7 @@ See [google_compute_route.md](google_compute_route.md) for more detailed informa * `next_hop_ips`: an array of `google_compute_route` next_hop_ip * `next_hop_vpn_tunnels`: an array of `google_compute_route` next_hop_vpn_tunnel * `next_hop_networks`: an array of `google_compute_route` next_hop_network + * `next_hop_ilbs`: an array of `google_compute_route` next_hop_ilb ## Filter Criteria This resource supports all of the above properties as filter criteria, which can be used diff --git a/docs/resources/google_compute_url_map.md b/docs/resources/google_compute_url_map.md index cdac30945..8359f2f0e 100644 --- a/docs/resources/google_compute_url_map.md +++ b/docs/resources/google_compute_url_map.md @@ -74,7 +74,7 @@ Properties that can be accessed from the `google_compute_url_map` resource: * `path_matchers`: The list of named PathMatchers to use against the URL. - * `default_service`: The BackendService resource. This will be used if none of the pathRules or routeRules defined by this PathMatcher are matched. For example, the following are all valid URLs to a BackendService resource: - https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backen dService - compute/v1/projects/project/global/backendServices/backendService - global/backendServices/backendService If defaultRouteAction is additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if defaultRouteAction specifies any weightedBackendServices, defaultService must not be specified. Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set. Authorization requires one or more of the following Google IAM permissions on the specified resource default_service: - compute.backendBuckets.use - compute.backendServices.use + * `default_service`: The BackendService resource. This will be used if none of the pathRules or routeRules defined by this PathMatcher are matched. For example, the following are all valid URLs to a BackendService resource: - https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backen dService - compute/v1/projects/project/global/backendServices/backendService - global/backendServices/backendService If defaultRouteAction is additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if defaultRouteAction specifies any weightedBackendServices, defaultService must not be specified. Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set. Authorization requires one or more of the following Google IAM permissions on the specified resource default_service: - compute.backendBuckets.use - compute.backendServices.use * `description`: An optional description of this resource. Provide this property when you create the resource. diff --git a/libraries/google_compute_route.rb b/libraries/google_compute_route.rb index 418a6a64f..ab85cee8c 100644 --- a/libraries/google_compute_route.rb +++ b/libraries/google_compute_route.rb @@ -33,6 +33,7 @@ class ComputeRoute < GcpResourceBase attr_reader :next_hop_ip attr_reader :next_hop_vpn_tunnel attr_reader :next_hop_network + attr_reader :next_hop_ilb def initialize(params) super(params.merge({ use_http_transport: true })) @@ -53,6 +54,7 @@ def parse @next_hop_ip = @fetched['nextHopIp'] @next_hop_vpn_tunnel = @fetched['nextHopVpnTunnel'] @next_hop_network = @fetched['nextHopNetwork'] + @next_hop_ilb = @fetched['nextHopIlb'] end # Handles parsing RFC3339 time string diff --git a/libraries/google_compute_routes.rb b/libraries/google_compute_routes.rb index 73fc8570a..c7ebc3f12 100644 --- a/libraries/google_compute_routes.rb +++ b/libraries/google_compute_routes.rb @@ -34,6 +34,7 @@ class ComputeRoutes < GcpResourceBase filter_table_config.add(:next_hop_ips, field: :next_hop_ip) filter_table_config.add(:next_hop_vpn_tunnels, field: :next_hop_vpn_tunnel) filter_table_config.add(:next_hop_networks, field: :next_hop_network) + filter_table_config.add(:next_hop_ilbs, field: :next_hop_ilb) filter_table_config.connect(self, :table) @@ -84,6 +85,7 @@ def transformers 'nextHopIp' => ->(obj) { return :next_hop_ip, obj['nextHopIp'] }, 'nextHopVpnTunnel' => ->(obj) { return :next_hop_vpn_tunnel, obj['nextHopVpnTunnel'] }, 'nextHopNetwork' => ->(obj) { return :next_hop_network, obj['nextHopNetwork'] }, + 'nextHopIlb' => ->(obj) { return :next_hop_ilb, obj['nextHopIlb'] }, } end