Skip to content

Commit

Permalink
Moving nexthop ILB to GA
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
chrisst committed Dec 12, 2019
1 parent a0fa15b commit 6009131
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 2 additions & 0 deletions docs/resources/google_compute_route.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions docs/resources/google_compute_routes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/google_compute_url_map.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 2 additions & 0 deletions libraries/google_compute_route.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 }))
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions libraries/google_compute_routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 6009131

Please sign in to comment.