Skip to main content
Providers

ForwardingRule

A resource of the GCP provider, version 0.2.0, in its Load Balancing group. Import it with:

import ForwardingRule from "gcp/loadbalancing"

Example

resource ForwardingRule example {
    name                = "example-value"
    target              = "example-value"
    portRange           = "example-value"
    ipProtocol          = "TCP"
    loadBalancingScheme = "EXTERNAL"
    network             = "example-value"
    subnetwork          = "example-value"
    region              = "example-value"
    labels              = "..."
    description         = "example-value"
}

Properties

Set by your code in the resource block. A required one must be set; any other you leave out takes the value under Default, if it has one.

NameTypeDefaultRequiredDescription
namestring—NoThe name of the forwarding rule
targetstring—NoThe target resource URL (target pool, proxy, or backend service)
portRangestring—NoThe port range for this forwarding rule (e.g., '80', '8080-8090')
ipProtocolstring"TCP"NoThe IP protocol for this forwarding rule Allowed: "TCP", "UDP", "ESP", "AH", "SCTP", "ICMP"
loadBalancingSchemestring"EXTERNAL"NoThe load balancing scheme Allowed: "EXTERNAL", "EXTERNAL_MANAGED", "INTERNAL", "INTERNAL_MANAGED", "INTERNAL_SELF_MANAGED"
networkstring—NoThe VPC network for internal load balancers
subnetworkstring—NoThe subnetwork for internal load balancers
regionstring—NoThe GCP region for this forwarding rule (regional rules only)
labelsobject—NoLabels to apply to the forwarding rule
descriptionstring—NoAn optional description

Set by GCP after the resource is created: your code can read them but not set them. An importable one identifies an existing resource.

NameTypeImportableDescription
forwardingRuleIdstringYesThe unique ID of the forwarding rule
selfLinkstringNoThe self-link URL of the forwarding rule
ipAddressstringNoThe IP address assigned to this forwarding rule

On this page