"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.GlobalNetworkEndpoint = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A Global Network endpoint represents a IP address and port combination that exists outside of GCP.
 * **NOTE**: Global network endpoints cannot be created outside of a
 * global network endpoint group.
 *
 * To get more information about GlobalNetworkEndpoint, 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/)
 *
 * ## Example Usage
 *
 * ### Global Network Endpoint
 *
 * ```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",
 * });
 * const default_endpoint = new gcp.compute.GlobalNetworkEndpoint("default-endpoint", {
 *     globalNetworkEndpointGroup: neg.name,
 *     fqdn: "www.example.com",
 *     port: 90,
 * });
 * ```
 *
 * ## Import
 *
 * GlobalNetworkEndpoint can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/global/networkEndpointGroups/{{global_network_endpoint_group}}/{{ip_address}}/{{fqdn}}/{{port}}`
 *
 * * `{{project}}/{{global_network_endpoint_group}}/{{ip_address}}/{{fqdn}}/{{port}}`
 *
 * * `{{global_network_endpoint_group}}/{{ip_address}}/{{fqdn}}/{{port}}`
 *
 * When using the `pulumi import` command, GlobalNetworkEndpoint can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:compute/globalNetworkEndpoint:GlobalNetworkEndpoint default projects/{{project}}/global/networkEndpointGroups/{{global_network_endpoint_group}}/{{ip_address}}/{{fqdn}}/{{port}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/globalNetworkEndpoint:GlobalNetworkEndpoint default {{project}}/{{global_network_endpoint_group}}/{{ip_address}}/{{fqdn}}/{{port}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/globalNetworkEndpoint:GlobalNetworkEndpoint default {{global_network_endpoint_group}}/{{ip_address}}/{{fqdn}}/{{port}}
 * ```
 */
class GlobalNetworkEndpoint extends pulumi.CustomResource {
    /**
     * Get an existing GlobalNetworkEndpoint 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 GlobalNetworkEndpoint(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of GlobalNetworkEndpoint.  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'] === GlobalNetworkEndpoint.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["fqdn"] = state?.fqdn;
            resourceInputs["globalNetworkEndpointGroup"] = state?.globalNetworkEndpointGroup;
            resourceInputs["ipAddress"] = state?.ipAddress;
            resourceInputs["port"] = state?.port;
            resourceInputs["project"] = state?.project;
        }
        else {
            const args = argsOrState;
            if (args?.globalNetworkEndpointGroup === undefined && !opts.urn) {
                throw new Error("Missing required property 'globalNetworkEndpointGroup'");
            }
            if (args?.port === undefined && !opts.urn) {
                throw new Error("Missing required property 'port'");
            }
            resourceInputs["fqdn"] = args?.fqdn;
            resourceInputs["globalNetworkEndpointGroup"] = args?.globalNetworkEndpointGroup;
            resourceInputs["ipAddress"] = args?.ipAddress;
            resourceInputs["port"] = args?.port;
            resourceInputs["project"] = args?.project;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(GlobalNetworkEndpoint.__pulumiType, name, resourceInputs, opts);
    }
}
exports.GlobalNetworkEndpoint = GlobalNetworkEndpoint;
/** @internal */
GlobalNetworkEndpoint.__pulumiType = 'gcp:compute/globalNetworkEndpoint:GlobalNetworkEndpoint';
//# sourceMappingURL=globalNetworkEndpoint.js.map