"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.TunnelDestGroup = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Tunnel destination groups represent resources that have the same tunnel access restrictions.
 *
 * To get more information about TunnelDestGroup, see:
 *
 * * [API documentation](https://cloud.google.com/iap/docs/reference/rest/v1/projects.iap_tunnel.locations.destGroups)
 * * How-to Guides
 *     * [Set up IAP TCP forwarding with an IP address or hostname in a Google Cloud or non-Google Cloud environment](https://cloud.google.com/iap/docs/tcp-by-host)
 *
 * ## Example Usage
 *
 * ### Iap Destgroup
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const destGroup = new gcp.iap.TunnelDestGroup("dest_group", {
 *     region: "us-central1",
 *     groupName: "testgroup_3684",
 *     cidrs: [
 *         "10.1.0.0/16",
 *         "192.168.10.0/24",
 *     ],
 * });
 * ```
 *
 * ## Import
 *
 * TunnelDestGroup can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/iap_tunnel/locations/{{region}}/destGroups/{{group_name}}`
 *
 * * `{{project}}/iap_tunnel/locations/{{region}}/destGroups/{{group_name}}`
 *
 * * `{{project}}/{{region}}/{{group_name}}`
 *
 * * `{{region}}/destGroups/{{group_name}}`
 *
 * * `{{region}}/{{group_name}}`
 *
 * * `{{group_name}}`
 *
 * When using the `pulumi import` command, TunnelDestGroup can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:iap/tunnelDestGroup:TunnelDestGroup default projects/{{project}}/iap_tunnel/locations/{{region}}/destGroups/{{group_name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:iap/tunnelDestGroup:TunnelDestGroup default {{project}}/iap_tunnel/locations/{{region}}/destGroups/{{group_name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:iap/tunnelDestGroup:TunnelDestGroup default {{project}}/{{region}}/{{group_name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:iap/tunnelDestGroup:TunnelDestGroup default {{region}}/destGroups/{{group_name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:iap/tunnelDestGroup:TunnelDestGroup default {{region}}/{{group_name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:iap/tunnelDestGroup:TunnelDestGroup default {{group_name}}
 * ```
 */
class TunnelDestGroup extends pulumi.CustomResource {
    /**
     * Get an existing TunnelDestGroup 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 TunnelDestGroup(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of TunnelDestGroup.  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'] === TunnelDestGroup.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["cidrs"] = state?.cidrs;
            resourceInputs["fqdns"] = state?.fqdns;
            resourceInputs["groupName"] = state?.groupName;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["region"] = state?.region;
        }
        else {
            const args = argsOrState;
            if (args?.groupName === undefined && !opts.urn) {
                throw new Error("Missing required property 'groupName'");
            }
            resourceInputs["cidrs"] = args?.cidrs;
            resourceInputs["fqdns"] = args?.fqdns;
            resourceInputs["groupName"] = args?.groupName;
            resourceInputs["project"] = args?.project;
            resourceInputs["region"] = args?.region;
            resourceInputs["name"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(TunnelDestGroup.__pulumiType, name, resourceInputs, opts);
    }
}
exports.TunnelDestGroup = TunnelDestGroup;
/** @internal */
TunnelDestGroup.__pulumiType = 'gcp:iap/tunnelDestGroup:TunnelDestGroup';
//# sourceMappingURL=tunnelDestGroup.js.map