Skip to main content

GCP Compute Forwarding Rule

A Google Cloud forwarding rule represents a single IP address and port or range of ports that forwards incoming traffic to a specific target resource such as a backend service or load balancer. Forwarding rules are created as part of load-balancing configurations and determine where packets that match the ruleโ€™s protocol, IP and port are delivered. They can be regional (for internal traffic or regional external load balancing) or global (for global external load balancing).
Official documentation: https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts

Terrafrom Mappings:

  • google_compute_forwarding_rule.name

Supported Methodsโ€‹

  • GET: Get GCP Compute Forwarding Rule by "gcp-compute-forwarding-rule-name"
  • LIST: List all GCP Compute Forwarding Rule items
  • SEARCH

gcp-compute-networkโ€‹

A forwarding rule is always associated with a VPC network. The network defines the address space within which an internal forwarding rule exists, or provides the egress path for an external forwarding rule.

gcp-compute-backend-serviceโ€‹

For load-balancing use-cases, the forwarding rule directs traffic to a backend service. Inspecting this link lets you see the collection of instance groups or endpoints that ultimately receive the traffic.

ipโ€‹

The forwarding rule reserves or references a specific external or internal IP address. Linking to the IP resource shows ownership and helps detect address conflicts across multi-cloud inventories.

gcp-compute-subnetworkโ€‹

When the forwarding rule is internal, it must reside in a particular subnetwork within its VPC. This link identifies the subnetwork that scopes the ruleโ€™s address range and reachability.