"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.ForwardingRule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A ForwardingRule resource. A ForwardingRule resource specifies which pool
 * of target virtual machines to forward a packet to if it matches the given
 * [IPAddress, IPProtocol, portRange] tuple.
 *
 * To get more information about ForwardingRule, see:
 *
 * * [API documentation](https://cloud.google.com/compute/docs/reference/v1/forwardingRules)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/compute/docs/load-balancing/network/forwarding-rules)
 *
 * ## Example Usage
 *
 * ### Forwarding Rule Externallb
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const hc = new gcp.compute.RegionHealthCheck("hc", {
 *     name: "check-website-backend",
 *     checkIntervalSec: 1,
 *     timeoutSec: 1,
 *     region: "us-central1",
 *     tcpHealthCheck: {
 *         port: 80,
 *     },
 * });
 * const backend = new gcp.compute.RegionBackendService("backend", {
 *     name: "website-backend",
 *     region: "us-central1",
 *     loadBalancingScheme: "EXTERNAL",
 *     healthChecks: hc.id,
 * });
 * // Forwarding rule for External Network Load Balancing using Backend Services
 * const _default = new gcp.compute.ForwardingRule("default", {
 *     name: "website-forwarding-rule",
 *     region: "us-central1",
 *     portRange: "80",
 *     backendService: backend.id,
 * });
 * ```
 * ### Forwarding Rule Global Internallb
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const hc = new gcp.compute.HealthCheck("hc", {
 *     name: "check-website-backend",
 *     checkIntervalSec: 1,
 *     timeoutSec: 1,
 *     tcpHealthCheck: {
 *         port: 80,
 *     },
 * });
 * const backend = new gcp.compute.RegionBackendService("backend", {
 *     name: "website-backend",
 *     region: "us-central1",
 *     healthChecks: hc.id,
 * });
 * const defaultNetwork = new gcp.compute.Network("default", {
 *     name: "website-net",
 *     autoCreateSubnetworks: false,
 * });
 * const defaultSubnetwork = new gcp.compute.Subnetwork("default", {
 *     name: "website-net",
 *     ipCidrRange: "10.0.0.0/16",
 *     region: "us-central1",
 *     network: defaultNetwork.id,
 * });
 * // Forwarding rule for Internal Load Balancing
 * const _default = new gcp.compute.ForwardingRule("default", {
 *     name: "website-forwarding-rule",
 *     region: "us-central1",
 *     loadBalancingScheme: "INTERNAL",
 *     backendService: backend.id,
 *     allPorts: true,
 *     allowGlobalAccess: true,
 *     network: defaultNetwork.name,
 *     subnetwork: defaultSubnetwork.name,
 * });
 * ```
 * ### Forwarding Rule Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const defaultTargetPool = new gcp.compute.TargetPool("default", {name: "website-target-pool"});
 * const _default = new gcp.compute.ForwardingRule("default", {
 *     name: "website-forwarding-rule",
 *     target: defaultTargetPool.id,
 *     portRange: "80",
 * });
 * ```
 * ### Forwarding Rule L3 Default
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const healthCheck = new gcp.compute.RegionHealthCheck("health_check", {
 *     name: "health-check",
 *     region: "us-central1",
 *     tcpHealthCheck: {
 *         port: 80,
 *     },
 * });
 * const service = new gcp.compute.RegionBackendService("service", {
 *     region: "us-central1",
 *     name: "service",
 *     healthChecks: healthCheck.id,
 *     protocol: "UNSPECIFIED",
 *     loadBalancingScheme: "EXTERNAL",
 * });
 * const fwdRule = new gcp.compute.ForwardingRule("fwd_rule", {
 *     name: "l3-forwarding-rule",
 *     backendService: service.id,
 *     ipProtocol: "L3_DEFAULT",
 *     allPorts: true,
 * });
 * ```
 * ### Forwarding Rule Internallb
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const hc = new gcp.compute.HealthCheck("hc", {
 *     name: "check-website-backend",
 *     checkIntervalSec: 1,
 *     timeoutSec: 1,
 *     tcpHealthCheck: {
 *         port: 80,
 *     },
 * });
 * const backend = new gcp.compute.RegionBackendService("backend", {
 *     name: "website-backend",
 *     region: "us-central1",
 *     healthChecks: hc.id,
 * });
 * const defaultNetwork = new gcp.compute.Network("default", {
 *     name: "website-net",
 *     autoCreateSubnetworks: false,
 * });
 * const defaultSubnetwork = new gcp.compute.Subnetwork("default", {
 *     name: "website-net",
 *     ipCidrRange: "10.0.0.0/16",
 *     region: "us-central1",
 *     network: defaultNetwork.id,
 * });
 * // Forwarding rule for Internal Load Balancing
 * const _default = new gcp.compute.ForwardingRule("default", {
 *     name: "website-forwarding-rule",
 *     region: "us-central1",
 *     loadBalancingScheme: "INTERNAL",
 *     backendService: backend.id,
 *     allPorts: true,
 *     network: defaultNetwork.name,
 *     subnetwork: defaultSubnetwork.name,
 *     ipVersion: "IPV4",
 * });
 * ```
 * ### Forwarding Rule Http Lb
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const debianImage = gcp.compute.getImage({
 *     family: "debian-11",
 *     project: "debian-cloud",
 * });
 * const defaultNetwork = new gcp.compute.Network("default", {
 *     name: "website-net",
 *     autoCreateSubnetworks: false,
 *     routingMode: "REGIONAL",
 * });
 * const defaultSubnetwork = new gcp.compute.Subnetwork("default", {
 *     name: "website-net-default",
 *     ipCidrRange: "10.1.2.0/24",
 *     region: "us-central1",
 *     network: defaultNetwork.id,
 * });
 * const instanceTemplate = new gcp.compute.InstanceTemplate("instance_template", {
 *     name: "template-website-backend",
 *     machineType: "e2-medium",
 *     networkInterfaces: [{
 *         network: defaultNetwork.id,
 *         subnetwork: defaultSubnetwork.id,
 *     }],
 *     disks: [{
 *         sourceImage: debianImage.then(debianImage => debianImage.selfLink),
 *         autoDelete: true,
 *         boot: true,
 *     }],
 *     tags: [
 *         "allow-ssh",
 *         "load-balanced-backend",
 *     ],
 * });
 * const rigm = new gcp.compute.RegionInstanceGroupManager("rigm", {
 *     region: "us-central1",
 *     name: "website-rigm",
 *     versions: [{
 *         instanceTemplate: instanceTemplate.id,
 *         name: "primary",
 *     }],
 *     baseInstanceName: "internal-glb",
 *     targetSize: 1,
 * });
 * const fw1 = new gcp.compute.Firewall("fw1", {
 *     name: "website-fw-1",
 *     network: defaultNetwork.id,
 *     sourceRanges: ["10.1.2.0/24"],
 *     allows: [
 *         {
 *             protocol: "tcp",
 *         },
 *         {
 *             protocol: "udp",
 *         },
 *         {
 *             protocol: "icmp",
 *         },
 *     ],
 *     direction: "INGRESS",
 * });
 * const fw2 = new gcp.compute.Firewall("fw2", {
 *     name: "website-fw-2",
 *     network: defaultNetwork.id,
 *     sourceRanges: ["0.0.0.0/0"],
 *     allows: [{
 *         protocol: "tcp",
 *         ports: ["22"],
 *     }],
 *     targetTags: ["allow-ssh"],
 *     direction: "INGRESS",
 * }, {
 *     dependsOn: [fw1],
 * });
 * const fw3 = new gcp.compute.Firewall("fw3", {
 *     name: "website-fw-3",
 *     network: defaultNetwork.id,
 *     sourceRanges: [
 *         "130.211.0.0/22",
 *         "35.191.0.0/16",
 *     ],
 *     allows: [{
 *         protocol: "tcp",
 *     }],
 *     targetTags: ["load-balanced-backend"],
 *     direction: "INGRESS",
 * }, {
 *     dependsOn: [fw2],
 * });
 * const fw4 = new gcp.compute.Firewall("fw4", {
 *     name: "website-fw-4",
 *     network: defaultNetwork.id,
 *     sourceRanges: ["10.129.0.0/26"],
 *     targetTags: ["load-balanced-backend"],
 *     allows: [
 *         {
 *             protocol: "tcp",
 *             ports: ["80"],
 *         },
 *         {
 *             protocol: "tcp",
 *             ports: ["443"],
 *         },
 *         {
 *             protocol: "tcp",
 *             ports: ["8000"],
 *         },
 *     ],
 *     direction: "INGRESS",
 * }, {
 *     dependsOn: [fw3],
 * });
 * const defaultRegionHealthCheck = new gcp.compute.RegionHealthCheck("default", {
 *     region: "us-central1",
 *     name: "website-hc",
 *     httpHealthCheck: {
 *         portSpecification: "USE_SERVING_PORT",
 *     },
 * }, {
 *     dependsOn: [fw4],
 * });
 * const defaultRegionBackendService = new gcp.compute.RegionBackendService("default", {
 *     loadBalancingScheme: "INTERNAL_MANAGED",
 *     backends: [{
 *         group: rigm.instanceGroup,
 *         balancingMode: "UTILIZATION",
 *         capacityScaler: 1,
 *     }],
 *     region: "us-central1",
 *     name: "website-backend",
 *     protocol: "HTTP",
 *     timeoutSec: 10,
 *     healthChecks: defaultRegionHealthCheck.id,
 * });
 * const defaultRegionUrlMap = new gcp.compute.RegionUrlMap("default", {
 *     region: "us-central1",
 *     name: "website-map",
 *     defaultService: defaultRegionBackendService.id,
 * });
 * const defaultRegionTargetHttpProxy = new gcp.compute.RegionTargetHttpProxy("default", {
 *     region: "us-central1",
 *     name: "website-proxy",
 *     urlMap: defaultRegionUrlMap.id,
 * });
 * const proxy = new gcp.compute.Subnetwork("proxy", {
 *     name: "website-net-proxy",
 *     ipCidrRange: "10.129.0.0/26",
 *     region: "us-central1",
 *     network: defaultNetwork.id,
 *     purpose: "REGIONAL_MANAGED_PROXY",
 *     role: "ACTIVE",
 * });
 * // Forwarding rule for Internal Load Balancing
 * const _default = new gcp.compute.ForwardingRule("default", {
 *     name: "website-forwarding-rule",
 *     region: "us-central1",
 *     ipProtocol: "TCP",
 *     loadBalancingScheme: "INTERNAL_MANAGED",
 *     portRange: "80",
 *     target: defaultRegionTargetHttpProxy.id,
 *     network: defaultNetwork.id,
 *     subnetwork: defaultSubnetwork.id,
 *     networkTier: "PREMIUM",
 * }, {
 *     dependsOn: [proxy],
 * });
 * ```
 * ### Forwarding Rule Regional Http Xlb
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const debianImage = gcp.compute.getImage({
 *     family: "debian-11",
 *     project: "debian-cloud",
 * });
 * const defaultNetwork = new gcp.compute.Network("default", {
 *     name: "website-net",
 *     autoCreateSubnetworks: false,
 *     routingMode: "REGIONAL",
 * });
 * const defaultSubnetwork = new gcp.compute.Subnetwork("default", {
 *     name: "website-net-default",
 *     ipCidrRange: "10.1.2.0/24",
 *     region: "us-central1",
 *     network: defaultNetwork.id,
 * });
 * const instanceTemplate = new gcp.compute.InstanceTemplate("instance_template", {
 *     name: "template-website-backend",
 *     machineType: "e2-medium",
 *     networkInterfaces: [{
 *         network: defaultNetwork.id,
 *         subnetwork: defaultSubnetwork.id,
 *     }],
 *     disks: [{
 *         sourceImage: debianImage.then(debianImage => debianImage.selfLink),
 *         autoDelete: true,
 *         boot: true,
 *     }],
 *     tags: [
 *         "allow-ssh",
 *         "load-balanced-backend",
 *     ],
 * });
 * const rigm = new gcp.compute.RegionInstanceGroupManager("rigm", {
 *     region: "us-central1",
 *     name: "website-rigm",
 *     versions: [{
 *         instanceTemplate: instanceTemplate.id,
 *         name: "primary",
 *     }],
 *     baseInstanceName: "internal-glb",
 *     targetSize: 1,
 * });
 * const fw1 = new gcp.compute.Firewall("fw1", {
 *     name: "website-fw-1",
 *     network: defaultNetwork.id,
 *     sourceRanges: ["10.1.2.0/24"],
 *     allows: [
 *         {
 *             protocol: "tcp",
 *         },
 *         {
 *             protocol: "udp",
 *         },
 *         {
 *             protocol: "icmp",
 *         },
 *     ],
 *     direction: "INGRESS",
 * });
 * const fw2 = new gcp.compute.Firewall("fw2", {
 *     name: "website-fw-2",
 *     network: defaultNetwork.id,
 *     sourceRanges: ["0.0.0.0/0"],
 *     allows: [{
 *         protocol: "tcp",
 *         ports: ["22"],
 *     }],
 *     targetTags: ["allow-ssh"],
 *     direction: "INGRESS",
 * }, {
 *     dependsOn: [fw1],
 * });
 * const fw3 = new gcp.compute.Firewall("fw3", {
 *     name: "website-fw-3",
 *     network: defaultNetwork.id,
 *     sourceRanges: [
 *         "130.211.0.0/22",
 *         "35.191.0.0/16",
 *     ],
 *     allows: [{
 *         protocol: "tcp",
 *     }],
 *     targetTags: ["load-balanced-backend"],
 *     direction: "INGRESS",
 * }, {
 *     dependsOn: [fw2],
 * });
 * const fw4 = new gcp.compute.Firewall("fw4", {
 *     name: "website-fw-4",
 *     network: defaultNetwork.id,
 *     sourceRanges: ["10.129.0.0/26"],
 *     targetTags: ["load-balanced-backend"],
 *     allows: [
 *         {
 *             protocol: "tcp",
 *             ports: ["80"],
 *         },
 *         {
 *             protocol: "tcp",
 *             ports: ["443"],
 *         },
 *         {
 *             protocol: "tcp",
 *             ports: ["8000"],
 *         },
 *     ],
 *     direction: "INGRESS",
 * }, {
 *     dependsOn: [fw3],
 * });
 * const defaultRegionHealthCheck = new gcp.compute.RegionHealthCheck("default", {
 *     region: "us-central1",
 *     name: "website-hc",
 *     httpHealthCheck: {
 *         portSpecification: "USE_SERVING_PORT",
 *     },
 * }, {
 *     dependsOn: [fw4],
 * });
 * const defaultRegionBackendService = new gcp.compute.RegionBackendService("default", {
 *     loadBalancingScheme: "EXTERNAL_MANAGED",
 *     backends: [{
 *         group: rigm.instanceGroup,
 *         balancingMode: "UTILIZATION",
 *         capacityScaler: 1,
 *     }],
 *     region: "us-central1",
 *     name: "website-backend",
 *     protocol: "HTTP",
 *     timeoutSec: 10,
 *     healthChecks: defaultRegionHealthCheck.id,
 * });
 * const defaultRegionUrlMap = new gcp.compute.RegionUrlMap("default", {
 *     region: "us-central1",
 *     name: "website-map",
 *     defaultService: defaultRegionBackendService.id,
 * });
 * const defaultRegionTargetHttpProxy = new gcp.compute.RegionTargetHttpProxy("default", {
 *     region: "us-central1",
 *     name: "website-proxy",
 *     urlMap: defaultRegionUrlMap.id,
 * });
 * const defaultAddress = new gcp.compute.Address("default", {
 *     name: "website-ip-1",
 *     region: "us-central1",
 *     networkTier: "STANDARD",
 * });
 * const proxy = new gcp.compute.Subnetwork("proxy", {
 *     name: "website-net-proxy",
 *     ipCidrRange: "10.129.0.0/26",
 *     region: "us-central1",
 *     network: defaultNetwork.id,
 *     purpose: "REGIONAL_MANAGED_PROXY",
 *     role: "ACTIVE",
 * });
 * // Forwarding rule for Regional External Load Balancing
 * const _default = new gcp.compute.ForwardingRule("default", {
 *     name: "website-forwarding-rule",
 *     region: "us-central1",
 *     ipProtocol: "TCP",
 *     loadBalancingScheme: "EXTERNAL_MANAGED",
 *     portRange: "80",
 *     target: defaultRegionTargetHttpProxy.id,
 *     network: defaultNetwork.id,
 *     ipAddress: defaultAddress.address,
 *     networkTier: "STANDARD",
 * }, {
 *     dependsOn: [proxy],
 * });
 * ```
 * ### Forwarding Rule Vpc Psc
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * // Consumer service endpoint
 * const consumerNet = new gcp.compute.Network("consumer_net", {
 *     name: "consumer-net",
 *     autoCreateSubnetworks: false,
 * });
 * const consumerSubnet = new gcp.compute.Subnetwork("consumer_subnet", {
 *     name: "consumer-net",
 *     ipCidrRange: "10.0.0.0/16",
 *     region: "us-central1",
 *     network: consumerNet.id,
 * });
 * const consumerAddress = new gcp.compute.Address("consumer_address", {
 *     name: "website-ip-1",
 *     region: "us-central1",
 *     subnetwork: consumerSubnet.id,
 *     addressType: "INTERNAL",
 * });
 * // Producer service attachment
 * const producerNet = new gcp.compute.Network("producer_net", {
 *     name: "producer-net",
 *     autoCreateSubnetworks: false,
 * });
 * const pscProducerSubnet = new gcp.compute.Subnetwork("psc_producer_subnet", {
 *     name: "producer-psc-net",
 *     ipCidrRange: "10.1.0.0/16",
 *     region: "us-central1",
 *     purpose: "PRIVATE_SERVICE_CONNECT",
 *     network: producerNet.id,
 * });
 * const producerSubnet = new gcp.compute.Subnetwork("producer_subnet", {
 *     name: "producer-net",
 *     ipCidrRange: "10.0.0.0/16",
 *     region: "us-central1",
 *     network: producerNet.id,
 * });
 * const producerServiceHealthCheck = new gcp.compute.HealthCheck("producer_service_health_check", {
 *     name: "producer-service-health-check",
 *     checkIntervalSec: 1,
 *     timeoutSec: 1,
 *     tcpHealthCheck: {
 *         port: 80,
 *     },
 * });
 * const producerServiceBackend = new gcp.compute.RegionBackendService("producer_service_backend", {
 *     name: "producer-service-backend",
 *     region: "us-central1",
 *     healthChecks: producerServiceHealthCheck.id,
 * });
 * const producerTargetService = new gcp.compute.ForwardingRule("producer_target_service", {
 *     name: "producer-forwarding-rule",
 *     region: "us-central1",
 *     loadBalancingScheme: "INTERNAL",
 *     backendService: producerServiceBackend.id,
 *     allPorts: true,
 *     network: producerNet.name,
 *     subnetwork: producerSubnet.name,
 * });
 * const producerServiceAttachment = new gcp.compute.ServiceAttachment("producer_service_attachment", {
 *     name: "producer-service",
 *     region: "us-central1",
 *     description: "A service attachment configured with Terraform",
 *     enableProxyProtocol: true,
 *     connectionPreference: "ACCEPT_AUTOMATIC",
 *     natSubnets: [pscProducerSubnet.name],
 *     targetService: producerTargetService.id,
 * });
 * // Forwarding rule for VPC private service connect
 * const _default = new gcp.compute.ForwardingRule("default", {
 *     name: "psc-endpoint",
 *     region: "us-central1",
 *     loadBalancingScheme: "",
 *     target: producerServiceAttachment.id,
 *     network: consumerNet.name,
 *     ipAddress: consumerAddress.id,
 *     allowPscGlobalAccess: true,
 * });
 * ```
 * ### Forwarding Rule Vpc Psc No Automate Dns
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const consumerNet = new gcp.compute.Network("consumer_net", {
 *     name: "consumer-net",
 *     autoCreateSubnetworks: false,
 * });
 * const consumerSubnet = new gcp.compute.Subnetwork("consumer_subnet", {
 *     name: "consumer-net",
 *     ipCidrRange: "10.0.0.0/16",
 *     region: "us-central1",
 *     network: consumerNet.id,
 * });
 * const consumerAddress = new gcp.compute.Address("consumer_address", {
 *     name: "website-ip-1",
 *     region: "us-central1",
 *     subnetwork: consumerSubnet.id,
 *     addressType: "INTERNAL",
 * });
 * const producerNet = new gcp.compute.Network("producer_net", {
 *     name: "producer-net",
 *     autoCreateSubnetworks: false,
 * });
 * const pscProducerSubnet = new gcp.compute.Subnetwork("psc_producer_subnet", {
 *     name: "producer-psc-net",
 *     ipCidrRange: "10.1.0.0/16",
 *     region: "us-central1",
 *     purpose: "PRIVATE_SERVICE_CONNECT",
 *     network: producerNet.id,
 * });
 * const producerSubnet = new gcp.compute.Subnetwork("producer_subnet", {
 *     name: "producer-net",
 *     ipCidrRange: "10.0.0.0/16",
 *     region: "us-central1",
 *     network: producerNet.id,
 * });
 * const producerServiceHealthCheck = new gcp.compute.HealthCheck("producer_service_health_check", {
 *     name: "producer-service-health-check",
 *     checkIntervalSec: 1,
 *     timeoutSec: 1,
 *     tcpHealthCheck: {
 *         port: 80,
 *     },
 * });
 * const producerServiceBackend = new gcp.compute.RegionBackendService("producer_service_backend", {
 *     name: "producer-service-backend",
 *     region: "us-central1",
 *     healthChecks: producerServiceHealthCheck.id,
 * });
 * const producerTargetService = new gcp.compute.ForwardingRule("producer_target_service", {
 *     name: "producer-forwarding-rule",
 *     region: "us-central1",
 *     loadBalancingScheme: "INTERNAL",
 *     backendService: producerServiceBackend.id,
 *     allPorts: true,
 *     network: producerNet.name,
 *     subnetwork: producerSubnet.name,
 * });
 * const producerServiceAttachment = new gcp.compute.ServiceAttachment("producer_service_attachment", {
 *     name: "producer-service",
 *     region: "us-central1",
 *     description: "A service attachment configured with Terraform",
 *     enableProxyProtocol: true,
 *     connectionPreference: "ACCEPT_AUTOMATIC",
 *     natSubnets: [pscProducerSubnet.name],
 *     targetService: producerTargetService.id,
 * });
 * const _default = new gcp.compute.ForwardingRule("default", {
 *     name: "psc-endpoint",
 *     region: "us-central1",
 *     loadBalancingScheme: "",
 *     target: producerServiceAttachment.id,
 *     network: consumerNet.name,
 *     ipAddress: consumerAddress.id,
 *     allowPscGlobalAccess: true,
 *     noAutomateDnsZone: true,
 * });
 * ```
 * ### Forwarding Rule Regional Steering
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const basic = new gcp.compute.Address("basic", {
 *     name: "website-ip",
 *     region: "us-central1",
 * });
 * const external = new gcp.compute.RegionBackendService("external", {
 *     name: "service-backend",
 *     region: "us-central1",
 *     loadBalancingScheme: "EXTERNAL",
 * });
 * const externalForwardingRule = new gcp.compute.ForwardingRule("external", {
 *     name: "external-forwarding-rule",
 *     region: "us-central1",
 *     ipAddress: basic.address,
 *     backendService: external.selfLink,
 *     loadBalancingScheme: "EXTERNAL",
 * });
 * const steering = new gcp.compute.ForwardingRule("steering", {
 *     name: "steering-rule",
 *     region: "us-central1",
 *     ipAddress: basic.address,
 *     backendService: external.selfLink,
 *     loadBalancingScheme: "EXTERNAL",
 *     sourceIpRanges: [
 *         "34.121.88.0/24",
 *         "35.187.239.137",
 *     ],
 * }, {
 *     dependsOn: [externalForwardingRule],
 * });
 * ```
 * ### Forwarding Rule Internallb Ipv6
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const hc = new gcp.compute.HealthCheck("hc", {
 *     name: "check-ilb-ipv6-backend",
 *     checkIntervalSec: 1,
 *     timeoutSec: 1,
 *     tcpHealthCheck: {
 *         port: 80,
 *     },
 * });
 * const backend = new gcp.compute.RegionBackendService("backend", {
 *     name: "ilb-ipv6-backend",
 *     region: "us-central1",
 *     healthChecks: hc.id,
 * });
 * const defaultNetwork = new gcp.compute.Network("default", {
 *     name: "net-ipv6",
 *     autoCreateSubnetworks: false,
 *     enableUlaInternalIpv6: true,
 * });
 * const defaultSubnetwork = new gcp.compute.Subnetwork("default", {
 *     name: "subnet-internal-ipv6",
 *     ipCidrRange: "10.0.0.0/16",
 *     region: "us-central1",
 *     stackType: "IPV4_IPV6",
 *     ipv6AccessType: "INTERNAL",
 *     network: defaultNetwork.id,
 * });
 * // Forwarding rule for Internal Load Balancing
 * const _default = new gcp.compute.ForwardingRule("default", {
 *     name: "ilb-ipv6-forwarding-rule",
 *     region: "us-central1",
 *     loadBalancingScheme: "INTERNAL",
 *     backendService: backend.id,
 *     allPorts: true,
 *     network: defaultNetwork.name,
 *     subnetwork: defaultSubnetwork.name,
 *     ipVersion: "IPV6",
 * });
 * ```
 *
 * ## Import
 *
 * ForwardingRule can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/regions/{{region}}/forwardingRules/{{name}}`
 *
 * * `{{project}}/{{region}}/{{name}}`
 *
 * * `{{region}}/{{name}}`
 *
 * * `{{name}}`
 *
 * When using the `pulumi import` command, ForwardingRule can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:compute/forwardingRule:ForwardingRule default projects/{{project}}/regions/{{region}}/forwardingRules/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/forwardingRule:ForwardingRule default {{project}}/{{region}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/forwardingRule:ForwardingRule default {{region}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/forwardingRule:ForwardingRule default {{name}}
 * ```
 */
class ForwardingRule extends pulumi.CustomResource {
    /**
     * Get an existing ForwardingRule resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state Any extra arguments used during the lookup.
     * @param opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name, id, state, opts) {
        return new ForwardingRule(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of ForwardingRule.  This is designed to work even
     * when multiple copies of the Pulumi SDK have been loaded into the same process.
     */
    static isInstance(obj) {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === ForwardingRule.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["allPorts"] = state?.allPorts;
            resourceInputs["allowGlobalAccess"] = state?.allowGlobalAccess;
            resourceInputs["allowPscGlobalAccess"] = state?.allowPscGlobalAccess;
            resourceInputs["backendService"] = state?.backendService;
            resourceInputs["baseForwardingRule"] = state?.baseForwardingRule;
            resourceInputs["creationTimestamp"] = state?.creationTimestamp;
            resourceInputs["description"] = state?.description;
            resourceInputs["effectiveLabels"] = state?.effectiveLabels;
            resourceInputs["forwardingRuleId"] = state?.forwardingRuleId;
            resourceInputs["ipAddress"] = state?.ipAddress;
            resourceInputs["ipCollection"] = state?.ipCollection;
            resourceInputs["ipProtocol"] = state?.ipProtocol;
            resourceInputs["ipVersion"] = state?.ipVersion;
            resourceInputs["isMirroringCollector"] = state?.isMirroringCollector;
            resourceInputs["labelFingerprint"] = state?.labelFingerprint;
            resourceInputs["labels"] = state?.labels;
            resourceInputs["loadBalancingScheme"] = state?.loadBalancingScheme;
            resourceInputs["name"] = state?.name;
            resourceInputs["network"] = state?.network;
            resourceInputs["networkTier"] = state?.networkTier;
            resourceInputs["noAutomateDnsZone"] = state?.noAutomateDnsZone;
            resourceInputs["portRange"] = state?.portRange;
            resourceInputs["ports"] = state?.ports;
            resourceInputs["project"] = state?.project;
            resourceInputs["pscConnectionId"] = state?.pscConnectionId;
            resourceInputs["pscConnectionStatus"] = state?.pscConnectionStatus;
            resourceInputs["pulumiLabels"] = state?.pulumiLabels;
            resourceInputs["recreateClosedPsc"] = state?.recreateClosedPsc;
            resourceInputs["region"] = state?.region;
            resourceInputs["selfLink"] = state?.selfLink;
            resourceInputs["serviceDirectoryRegistrations"] = state?.serviceDirectoryRegistrations;
            resourceInputs["serviceLabel"] = state?.serviceLabel;
            resourceInputs["serviceName"] = state?.serviceName;
            resourceInputs["sourceIpRanges"] = state?.sourceIpRanges;
            resourceInputs["subnetwork"] = state?.subnetwork;
            resourceInputs["target"] = state?.target;
        }
        else {
            const args = argsOrState;
            resourceInputs["allPorts"] = args?.allPorts;
            resourceInputs["allowGlobalAccess"] = args?.allowGlobalAccess;
            resourceInputs["allowPscGlobalAccess"] = args?.allowPscGlobalAccess;
            resourceInputs["backendService"] = args?.backendService;
            resourceInputs["description"] = args?.description;
            resourceInputs["ipAddress"] = args?.ipAddress;
            resourceInputs["ipCollection"] = args?.ipCollection;
            resourceInputs["ipProtocol"] = args?.ipProtocol;
            resourceInputs["ipVersion"] = args?.ipVersion;
            resourceInputs["isMirroringCollector"] = args?.isMirroringCollector;
            resourceInputs["labels"] = args?.labels;
            resourceInputs["loadBalancingScheme"] = args?.loadBalancingScheme;
            resourceInputs["name"] = args?.name;
            resourceInputs["network"] = args?.network;
            resourceInputs["networkTier"] = args?.networkTier;
            resourceInputs["noAutomateDnsZone"] = args?.noAutomateDnsZone;
            resourceInputs["portRange"] = args?.portRange;
            resourceInputs["ports"] = args?.ports;
            resourceInputs["project"] = args?.project;
            resourceInputs["recreateClosedPsc"] = args?.recreateClosedPsc;
            resourceInputs["region"] = args?.region;
            resourceInputs["serviceDirectoryRegistrations"] = args?.serviceDirectoryRegistrations;
            resourceInputs["serviceLabel"] = args?.serviceLabel;
            resourceInputs["sourceIpRanges"] = args?.sourceIpRanges;
            resourceInputs["subnetwork"] = args?.subnetwork;
            resourceInputs["target"] = args?.target;
            resourceInputs["baseForwardingRule"] = undefined /*out*/;
            resourceInputs["creationTimestamp"] = undefined /*out*/;
            resourceInputs["effectiveLabels"] = undefined /*out*/;
            resourceInputs["forwardingRuleId"] = undefined /*out*/;
            resourceInputs["labelFingerprint"] = undefined /*out*/;
            resourceInputs["pscConnectionId"] = undefined /*out*/;
            resourceInputs["pscConnectionStatus"] = undefined /*out*/;
            resourceInputs["pulumiLabels"] = undefined /*out*/;
            resourceInputs["selfLink"] = undefined /*out*/;
            resourceInputs["serviceName"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(ForwardingRule.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ForwardingRule = ForwardingRule;
/** @internal */
ForwardingRule.__pulumiType = 'gcp:compute/forwardingRule:ForwardingRule';
//# sourceMappingURL=forwardingRule.js.map