"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.NodeGroup = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Represents a NodeGroup resource to manage a group of sole-tenant nodes.
 *
 * To get more information about NodeGroup, see:
 *
 * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/nodeGroups)
 * * How-to Guides
 *     * [Sole-Tenant Nodes](https://cloud.google.com/compute/docs/nodes/)
 *
 * > **Warning:** Due to limitations of the API, this provider cannot update the
 * number of nodes in a node group and changes to node group size either
 * through provider config or through external changes will cause
 * the provider to delete and recreate the node group.
 *
 * ## Example Usage
 *
 * ### Node Group Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const soletenant_tmpl = new gcp.compute.NodeTemplate("soletenant-tmpl", {
 *     name: "soletenant-tmpl",
 *     region: "us-central1",
 *     nodeType: "n1-node-96-624",
 * });
 * const nodes = new gcp.compute.NodeGroup("nodes", {
 *     name: "soletenant-group",
 *     zone: "us-central1-a",
 *     description: "example google_compute_node_group for the Google Provider",
 *     initialSize: 1,
 *     nodeTemplate: soletenant_tmpl.id,
 * });
 * ```
 * ### Node Group Maintenance Interval
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const soletenant_tmpl = new gcp.compute.NodeTemplate("soletenant-tmpl", {
 *     name: "soletenant-tmpl",
 *     region: "us-central1",
 *     nodeType: "c2-node-60-240",
 * });
 * const nodes = new gcp.compute.NodeGroup("nodes", {
 *     name: "soletenant-group",
 *     zone: "us-central1-a",
 *     description: "example google_compute_node_group for Terraform Google Provider",
 *     initialSize: 1,
 *     nodeTemplate: soletenant_tmpl.id,
 *     maintenanceInterval: "RECURRENT",
 * });
 * ```
 * ### Node Group Autoscaling Policy
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const soletenant_tmpl = new gcp.compute.NodeTemplate("soletenant-tmpl", {
 *     name: "soletenant-tmpl",
 *     region: "us-central1",
 *     nodeType: "n1-node-96-624",
 * });
 * const nodes = new gcp.compute.NodeGroup("nodes", {
 *     name: "soletenant-group",
 *     zone: "us-central1-a",
 *     description: "example google_compute_node_group for Google Provider",
 *     maintenancePolicy: "RESTART_IN_PLACE",
 *     maintenanceWindow: {
 *         startTime: "08:00",
 *     },
 *     initialSize: 1,
 *     nodeTemplate: soletenant_tmpl.id,
 *     autoscalingPolicy: {
 *         mode: "ONLY_SCALE_OUT",
 *         minNodes: 1,
 *         maxNodes: 10,
 *     },
 * });
 * ```
 * ### Node Group Share Settings
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const guestProject = new gcp.organizations.Project("guest_project", {
 *     projectId: "project-id",
 *     name: "project-name",
 *     orgId: "123456789",
 *     deletionPolicy: "DELETE",
 * });
 * const soletenant_tmpl = new gcp.compute.NodeTemplate("soletenant-tmpl", {
 *     name: "soletenant-tmpl",
 *     region: "us-central1",
 *     nodeType: "n1-node-96-624",
 * });
 * const nodes = new gcp.compute.NodeGroup("nodes", {
 *     name: "soletenant-group",
 *     zone: "us-central1-f",
 *     description: "example google_compute_node_group for Terraform Google Provider",
 *     initialSize: 1,
 *     nodeTemplate: soletenant_tmpl.id,
 *     shareSettings: {
 *         shareType: "SPECIFIC_PROJECTS",
 *         projectMaps: [{
 *             id: guestProject.projectId,
 *             projectId: guestProject.projectId,
 *         }],
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * NodeGroup can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/zones/{{zone}}/nodeGroups/{{name}}`
 *
 * * `{{project}}/{{zone}}/{{name}}`
 *
 * * `{{zone}}/{{name}}`
 *
 * * `{{name}}`
 *
 * When using the `pulumi import` command, NodeGroup can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:compute/nodeGroup:NodeGroup default projects/{{project}}/zones/{{zone}}/nodeGroups/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/nodeGroup:NodeGroup default {{project}}/{{zone}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/nodeGroup:NodeGroup default {{zone}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/nodeGroup:NodeGroup default {{name}}
 * ```
 */
class NodeGroup extends pulumi.CustomResource {
    /**
     * Get an existing NodeGroup 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 NodeGroup(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of NodeGroup.  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'] === NodeGroup.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["autoscalingPolicy"] = state?.autoscalingPolicy;
            resourceInputs["creationTimestamp"] = state?.creationTimestamp;
            resourceInputs["description"] = state?.description;
            resourceInputs["initialSize"] = state?.initialSize;
            resourceInputs["maintenanceInterval"] = state?.maintenanceInterval;
            resourceInputs["maintenancePolicy"] = state?.maintenancePolicy;
            resourceInputs["maintenanceWindow"] = state?.maintenanceWindow;
            resourceInputs["name"] = state?.name;
            resourceInputs["nodeTemplate"] = state?.nodeTemplate;
            resourceInputs["project"] = state?.project;
            resourceInputs["selfLink"] = state?.selfLink;
            resourceInputs["shareSettings"] = state?.shareSettings;
            resourceInputs["size"] = state?.size;
            resourceInputs["zone"] = state?.zone;
        }
        else {
            const args = argsOrState;
            if (args?.nodeTemplate === undefined && !opts.urn) {
                throw new Error("Missing required property 'nodeTemplate'");
            }
            resourceInputs["autoscalingPolicy"] = args?.autoscalingPolicy;
            resourceInputs["description"] = args?.description;
            resourceInputs["initialSize"] = args?.initialSize;
            resourceInputs["maintenanceInterval"] = args?.maintenanceInterval;
            resourceInputs["maintenancePolicy"] = args?.maintenancePolicy;
            resourceInputs["maintenanceWindow"] = args?.maintenanceWindow;
            resourceInputs["name"] = args?.name;
            resourceInputs["nodeTemplate"] = args?.nodeTemplate;
            resourceInputs["project"] = args?.project;
            resourceInputs["shareSettings"] = args?.shareSettings;
            resourceInputs["zone"] = args?.zone;
            resourceInputs["creationTimestamp"] = undefined /*out*/;
            resourceInputs["selfLink"] = undefined /*out*/;
            resourceInputs["size"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(NodeGroup.__pulumiType, name, resourceInputs, opts);
    }
}
exports.NodeGroup = NodeGroup;
/** @internal */
NodeGroup.__pulumiType = 'gcp:compute/nodeGroup:NodeGroup';
//# sourceMappingURL=nodeGroup.js.map