"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.InstanceGroup = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Creates a group of dissimilar Compute Engine virtual machine instances.
 * For more information, see [the official documentation](https://cloud.google.com/compute/docs/instance-groups/#unmanaged_instance_groups)
 * and [API](https://cloud.google.com/compute/docs/reference/latest/instanceGroups)
 *
 * ## Example Usage
 *
 * ### Empty Instance Group
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const test = new gcp.compute.InstanceGroup("test", {
 *     name: "test",
 *     description: "Test instance group",
 *     zone: "us-central1-a",
 *     network: _default.id,
 * });
 * ```
 *
 * ### Example Usage - With instances and named ports
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const webservers = new gcp.compute.InstanceGroup("webservers", {
 *     name: "webservers",
 *     description: "Test instance group",
 *     instances: [
 *         test.id,
 *         test2.id,
 *     ],
 *     namedPorts: [
 *         {
 *             name: "http",
 *             port: 8080,
 *         },
 *         {
 *             name: "https",
 *             port: 8443,
 *         },
 *     ],
 *     zone: "us-central1-a",
 * });
 * ```
 *
 * ## Import
 *
 * Instance groups can be imported using the `zone` and `name` with an optional `project`, e.g.
 *
 * * `projects/{{project_id}}/zones/{{zone}}/instanceGroups/{{instance_group_id}}`
 *
 * * `{{project_id}}/{{zone}}/{{instance_group_id}}`
 *
 * * `{{zone}}/{{instance_group_id}}`
 *
 * When using the `pulumi import` command, instance groups can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:compute/instanceGroup:InstanceGroup default {{zone}}/{{instance_group_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/instanceGroup:InstanceGroup default {{project_id}}/{{zone}}/{{instance_group_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/instanceGroup:InstanceGroup default projects/{{project_id}}/zones/{{zone}}/instanceGroups/{{instance_group_id}}
 * ```
 */
class InstanceGroup extends pulumi.CustomResource {
    /**
     * Get an existing InstanceGroup 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 InstanceGroup(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of InstanceGroup.  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'] === InstanceGroup.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["description"] = state?.description;
            resourceInputs["instances"] = state?.instances;
            resourceInputs["name"] = state?.name;
            resourceInputs["namedPorts"] = state?.namedPorts;
            resourceInputs["network"] = state?.network;
            resourceInputs["project"] = state?.project;
            resourceInputs["selfLink"] = state?.selfLink;
            resourceInputs["size"] = state?.size;
            resourceInputs["zone"] = state?.zone;
        }
        else {
            const args = argsOrState;
            resourceInputs["description"] = args?.description;
            resourceInputs["instances"] = args?.instances;
            resourceInputs["name"] = args?.name;
            resourceInputs["namedPorts"] = args?.namedPorts;
            resourceInputs["network"] = args?.network;
            resourceInputs["project"] = args?.project;
            resourceInputs["zone"] = args?.zone;
            resourceInputs["selfLink"] = undefined /*out*/;
            resourceInputs["size"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(InstanceGroup.__pulumiType, name, resourceInputs, opts);
    }
}
exports.InstanceGroup = InstanceGroup;
/** @internal */
InstanceGroup.__pulumiType = 'gcp:compute/instanceGroup:InstanceGroup';
//# sourceMappingURL=instanceGroup.js.map