"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.RegionNetworkEndpointGroup = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A regional NEG that can support Serverless Products, proxying traffic to
 * external backends and providing traffic to the PSC port mapping endpoints.
 *
 * To get more information about RegionNetworkEndpointGroup, see:
 *
 * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/beta/regionNetworkEndpointGroups)
 * * How-to Guides
 *     * [Internet NEGs Official Documentation](https://cloud.google.com/load-balancing/docs/negs/internet-neg-concepts)
 *     * [Serverless NEGs Official Documentation](https://cloud.google.com/load-balancing/docs/negs/serverless-neg-concepts)
 *
 * ## Example Usage
 *
 * ### Region Network Endpoint Group Functions
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const bucket = new gcp.storage.Bucket("bucket", {
 *     name: "cloudfunctions-function-example-bucket",
 *     location: "US",
 * });
 * const archive = new gcp.storage.BucketObject("archive", {
 *     name: "index.zip",
 *     bucket: bucket.name,
 *     source: new pulumi.asset.FileAsset("path/to/index.zip"),
 * });
 * const functionNegFunction = new gcp.cloudfunctions.Function("function_neg", {
 *     name: "function-neg",
 *     description: "My function",
 *     runtime: "nodejs20",
 *     availableMemoryMb: 128,
 *     sourceArchiveBucket: bucket.name,
 *     sourceArchiveObject: archive.name,
 *     triggerHttp: true,
 *     timeout: 60,
 *     entryPoint: "helloGET",
 * });
 * // Cloud Functions Example
 * const functionNeg = new gcp.compute.RegionNetworkEndpointGroup("function_neg", {
 *     name: "function-neg",
 *     networkEndpointType: "SERVERLESS",
 *     region: "us-central1",
 *     cloudFunction: {
 *         "function": functionNegFunction.name,
 *     },
 * });
 * ```
 * ### Region Network Endpoint Group Cloudrun
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const cloudrunNegService = new gcp.cloudrun.Service("cloudrun_neg", {
 *     name: "cloudrun-neg",
 *     location: "us-central1",
 *     template: {
 *         spec: {
 *             containers: [{
 *                 image: "us-docker.pkg.dev/cloudrun/container/hello",
 *             }],
 *         },
 *     },
 *     traffics: [{
 *         percent: 100,
 *         latestRevision: true,
 *     }],
 * });
 * // Cloud Run Example
 * const cloudrunNeg = new gcp.compute.RegionNetworkEndpointGroup("cloudrun_neg", {
 *     name: "cloudrun-neg",
 *     networkEndpointType: "SERVERLESS",
 *     region: "us-central1",
 *     cloudRun: {
 *         service: cloudrunNegService.name,
 *     },
 * });
 * ```
 * ### Region Network Endpoint Group Appengine
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const appengineNegBucket = new gcp.storage.Bucket("appengine_neg", {
 *     name: "appengine-neg",
 *     location: "US",
 *     uniformBucketLevelAccess: true,
 * });
 * const appengineNegBucketObject = new gcp.storage.BucketObject("appengine_neg", {
 *     name: "hello-world.zip",
 *     bucket: appengineNegBucket.name,
 *     source: new pulumi.asset.FileAsset("./test-fixtures/hello-world.zip"),
 * });
 * const appengineNegFlexibleAppVersion = new gcp.appengine.FlexibleAppVersion("appengine_neg", {
 *     versionId: "v1",
 *     service: "appengine-neg",
 *     runtime: "nodejs",
 *     flexibleRuntimeSettings: {
 *         operatingSystem: "ubuntu22",
 *         runtimeVersion: "20",
 *     },
 *     entrypoint: {
 *         shell: "node ./app.js",
 *     },
 *     deployment: {
 *         zip: {
 *             sourceUrl: pulumi.interpolate`https://storage.googleapis.com/${appengineNegBucket.name}/${appengineNegBucketObject.name}`,
 *         },
 *     },
 *     livenessCheck: {
 *         path: "/",
 *     },
 *     readinessCheck: {
 *         path: "/",
 *     },
 *     envVariables: {
 *         port: "8080",
 *     },
 *     handlers: [{
 *         urlRegex: ".*\\/my-path\\/*",
 *         securityLevel: "SECURE_ALWAYS",
 *         login: "LOGIN_REQUIRED",
 *         authFailAction: "AUTH_FAIL_ACTION_REDIRECT",
 *         staticFiles: {
 *             path: "my-other-path",
 *             uploadPathRegex: ".*\\/my-path\\/*",
 *         },
 *     }],
 *     automaticScaling: {
 *         coolDownPeriod: "120s",
 *         cpuUtilization: {
 *             targetUtilization: 0.5,
 *         },
 *     },
 *     deleteServiceOnDestroy: true,
 * });
 * // App Engine Example
 * const appengineNeg = new gcp.compute.RegionNetworkEndpointGroup("appengine_neg", {
 *     name: "appengine-neg",
 *     networkEndpointType: "SERVERLESS",
 *     region: "us-central1",
 *     appEngine: {
 *         service: appengineNegFlexibleAppVersion.service,
 *         version: appengineNegFlexibleAppVersion.versionId,
 *     },
 * });
 * ```
 * ### Region Network Endpoint Group Appengine Empty
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * // App Engine Example
 * const appengineNeg = new gcp.compute.RegionNetworkEndpointGroup("appengine_neg", {
 *     name: "appengine-neg",
 *     networkEndpointType: "SERVERLESS",
 *     region: "us-central1",
 *     appEngine: {},
 * });
 * ```
 * ### Region Network Endpoint Group Psc
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const pscNeg = new gcp.compute.RegionNetworkEndpointGroup("psc_neg", {
 *     name: "psc-neg",
 *     region: "asia-northeast3",
 *     networkEndpointType: "PRIVATE_SERVICE_CONNECT",
 *     pscTargetService: "asia-northeast3-cloudkms.googleapis.com",
 * });
 * ```
 * ### Region Network Endpoint Group Psc Service Attachment
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const _default = new gcp.compute.Network("default", {name: "psc-network"});
 * const defaultSubnetwork = new gcp.compute.Subnetwork("default", {
 *     name: "psc-subnetwork",
 *     ipCidrRange: "10.0.0.0/16",
 *     region: "europe-west4",
 *     network: _default.id,
 * });
 * const pscSubnetwork = new gcp.compute.Subnetwork("psc_subnetwork", {
 *     name: "psc-subnetwork-nat",
 *     ipCidrRange: "10.1.0.0/16",
 *     region: "europe-west4",
 *     purpose: "PRIVATE_SERVICE_CONNECT",
 *     network: _default.id,
 * });
 * const defaultHealthCheck = new gcp.compute.HealthCheck("default", {
 *     name: "psc-healthcheck",
 *     checkIntervalSec: 1,
 *     timeoutSec: 1,
 *     tcpHealthCheck: {
 *         port: 80,
 *     },
 * });
 * const defaultRegionBackendService = new gcp.compute.RegionBackendService("default", {
 *     name: "psc-backend",
 *     region: "europe-west4",
 *     healthChecks: defaultHealthCheck.id,
 * });
 * const defaultForwardingRule = new gcp.compute.ForwardingRule("default", {
 *     name: "psc-forwarding-rule",
 *     region: "europe-west4",
 *     loadBalancingScheme: "INTERNAL",
 *     backendService: defaultRegionBackendService.id,
 *     ports: [
 *         "80",
 *         "88",
 *         "443",
 *     ],
 *     network: _default.name,
 *     subnetwork: defaultSubnetwork.name,
 * });
 * const defaultServiceAttachment = new gcp.compute.ServiceAttachment("default", {
 *     name: "psc-service-attachment",
 *     region: "europe-west4",
 *     description: "A service attachment configured with Terraform",
 *     enableProxyProtocol: false,
 *     connectionPreference: "ACCEPT_AUTOMATIC",
 *     natSubnets: [pscSubnetwork.selfLink],
 *     targetService: defaultForwardingRule.selfLink,
 * });
 * const pscNegServiceAttachment = new gcp.compute.RegionNetworkEndpointGroup("psc_neg_service_attachment", {
 *     name: "psc-neg",
 *     region: "europe-west4",
 *     networkEndpointType: "PRIVATE_SERVICE_CONNECT",
 *     pscTargetService: defaultServiceAttachment.selfLink,
 *     pscData: {
 *         producerPort: "88",
 *     },
 *     subnetwork: defaultSubnetwork.selfLink,
 * });
 * ```
 * ### Region Network Endpoint Group Internet Ip Port
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const _default = new gcp.compute.Network("default", {name: "network"});
 * const regionNetworkEndpointGroupInternetIpPort = new gcp.compute.RegionNetworkEndpointGroup("region_network_endpoint_group_internet_ip_port", {
 *     name: "ip-port-neg",
 *     region: "us-central1",
 *     network: _default.id,
 *     networkEndpointType: "INTERNET_IP_PORT",
 * });
 * ```
 * ### Region Network Endpoint Group Internet Fqdn Port
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const _default = new gcp.compute.Network("default", {name: "network"});
 * const regionNetworkEndpointGroupInternetFqdnPort = new gcp.compute.RegionNetworkEndpointGroup("region_network_endpoint_group_internet_fqdn_port", {
 *     name: "ip-port-neg",
 *     region: "us-central1",
 *     network: _default.id,
 *     networkEndpointType: "INTERNET_FQDN_PORT",
 * });
 * ```
 * ### Region Network Endpoint Group Portmap
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const _default = new gcp.compute.Network("default", {name: "network"});
 * const defaultSubnetwork = new gcp.compute.Subnetwork("default", {
 *     name: "subnetwork",
 *     ipCidrRange: "10.0.0.0/16",
 *     region: "us-central1",
 *     network: _default.id,
 * });
 * const regionNetworkEndpointGroupPortmap = new gcp.compute.RegionNetworkEndpointGroup("region_network_endpoint_group_portmap", {
 *     name: "portmap-neg",
 *     region: "us-central1",
 *     network: _default.id,
 *     subnetwork: defaultSubnetwork.id,
 *     networkEndpointType: "GCE_VM_IP_PORTMAP",
 * });
 * ```
 *
 * ## Import
 *
 * RegionNetworkEndpointGroup can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/regions/{{region}}/networkEndpointGroups/{{name}}`
 *
 * * `{{project}}/{{region}}/{{name}}`
 *
 * * `{{region}}/{{name}}`
 *
 * * `{{name}}`
 *
 * When using the `pulumi import` command, RegionNetworkEndpointGroup can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:compute/regionNetworkEndpointGroup:RegionNetworkEndpointGroup default projects/{{project}}/regions/{{region}}/networkEndpointGroups/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/regionNetworkEndpointGroup:RegionNetworkEndpointGroup default {{project}}/{{region}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/regionNetworkEndpointGroup:RegionNetworkEndpointGroup default {{region}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/regionNetworkEndpointGroup:RegionNetworkEndpointGroup default {{name}}
 * ```
 */
class RegionNetworkEndpointGroup extends pulumi.CustomResource {
    /**
     * Get an existing RegionNetworkEndpointGroup 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 RegionNetworkEndpointGroup(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of RegionNetworkEndpointGroup.  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'] === RegionNetworkEndpointGroup.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["appEngine"] = state?.appEngine;
            resourceInputs["cloudFunction"] = state?.cloudFunction;
            resourceInputs["cloudRun"] = state?.cloudRun;
            resourceInputs["description"] = state?.description;
            resourceInputs["name"] = state?.name;
            resourceInputs["network"] = state?.network;
            resourceInputs["networkEndpointType"] = state?.networkEndpointType;
            resourceInputs["project"] = state?.project;
            resourceInputs["pscData"] = state?.pscData;
            resourceInputs["pscTargetService"] = state?.pscTargetService;
            resourceInputs["region"] = state?.region;
            resourceInputs["selfLink"] = state?.selfLink;
            resourceInputs["serverlessDeployment"] = state?.serverlessDeployment;
            resourceInputs["subnetwork"] = state?.subnetwork;
        }
        else {
            const args = argsOrState;
            if (args?.region === undefined && !opts.urn) {
                throw new Error("Missing required property 'region'");
            }
            resourceInputs["appEngine"] = args?.appEngine;
            resourceInputs["cloudFunction"] = args?.cloudFunction;
            resourceInputs["cloudRun"] = args?.cloudRun;
            resourceInputs["description"] = args?.description;
            resourceInputs["name"] = args?.name;
            resourceInputs["network"] = args?.network;
            resourceInputs["networkEndpointType"] = args?.networkEndpointType;
            resourceInputs["project"] = args?.project;
            resourceInputs["pscData"] = args?.pscData;
            resourceInputs["pscTargetService"] = args?.pscTargetService;
            resourceInputs["region"] = args?.region;
            resourceInputs["serverlessDeployment"] = args?.serverlessDeployment;
            resourceInputs["subnetwork"] = args?.subnetwork;
            resourceInputs["selfLink"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(RegionNetworkEndpointGroup.__pulumiType, name, resourceInputs, opts);
    }
}
exports.RegionNetworkEndpointGroup = RegionNetworkEndpointGroup;
/** @internal */
RegionNetworkEndpointGroup.__pulumiType = 'gcp:compute/regionNetworkEndpointGroup:RegionNetworkEndpointGroup';
//# sourceMappingURL=regionNetworkEndpointGroup.js.map