"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.GlobalNetworkEndpointGroup = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A global network endpoint group contains endpoints that reside outside of Google Cloud.
 * Currently a global network endpoint group can only support a single endpoint.
 *
 * Recreating a global network endpoint group that's in use by another resource will give a
 * `resourceInUseByAnotherResource` error. Use `lifecycle.create_before_destroy`
 * to avoid this type of error.
 *
 * To get more information about GlobalNetworkEndpointGroup, see:
 *
 * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/beta/networkEndpointGroups)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/load-balancing/docs/negs/internet-neg-concepts)
 *
 * ## Example Usage
 *
 * ### Global Network Endpoint Group
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const neg = new gcp.compute.GlobalNetworkEndpointGroup("neg", {
 *     name: "my-lb-neg",
 *     defaultPort: 90,
 *     networkEndpointType: "INTERNET_FQDN_PORT",
 * });
 * ```
 * ### Global Network Endpoint Group Ip Address
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const neg = new gcp.compute.GlobalNetworkEndpointGroup("neg", {
 *     name: "my-lb-neg",
 *     networkEndpointType: "INTERNET_IP_PORT",
 *     defaultPort: 90,
 * });
 * ```
 *
 * ## Import
 *
 * GlobalNetworkEndpointGroup can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/global/networkEndpointGroups/{{name}}`
 *
 * * `{{project}}/{{name}}`
 *
 * * `{{name}}`
 *
 * When using the `pulumi import` command, GlobalNetworkEndpointGroup can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:compute/globalNetworkEndpointGroup:GlobalNetworkEndpointGroup default projects/{{project}}/global/networkEndpointGroups/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/globalNetworkEndpointGroup:GlobalNetworkEndpointGroup default {{project}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/globalNetworkEndpointGroup:GlobalNetworkEndpointGroup default {{name}}
 * ```
 */
class GlobalNetworkEndpointGroup extends pulumi.CustomResource {
    /**
     * Get an existing GlobalNetworkEndpointGroup 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 GlobalNetworkEndpointGroup(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of GlobalNetworkEndpointGroup.  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'] === GlobalNetworkEndpointGroup.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["defaultPort"] = state?.defaultPort;
            resourceInputs["description"] = state?.description;
            resourceInputs["name"] = state?.name;
            resourceInputs["networkEndpointType"] = state?.networkEndpointType;
            resourceInputs["project"] = state?.project;
            resourceInputs["selfLink"] = state?.selfLink;
        }
        else {
            const args = argsOrState;
            if (args?.networkEndpointType === undefined && !opts.urn) {
                throw new Error("Missing required property 'networkEndpointType'");
            }
            resourceInputs["defaultPort"] = args?.defaultPort;
            resourceInputs["description"] = args?.description;
            resourceInputs["name"] = args?.name;
            resourceInputs["networkEndpointType"] = args?.networkEndpointType;
            resourceInputs["project"] = args?.project;
            resourceInputs["selfLink"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(GlobalNetworkEndpointGroup.__pulumiType, name, resourceInputs, opts);
    }
}
exports.GlobalNetworkEndpointGroup = GlobalNetworkEndpointGroup;
/** @internal */
GlobalNetworkEndpointGroup.__pulumiType = 'gcp:compute/globalNetworkEndpointGroup:GlobalNetworkEndpointGroup';
//# sourceMappingURL=globalNetworkEndpointGroup.js.map