"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.NodeTemplate = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Represents a NodeTemplate resource. Node templates specify properties
 * for creating sole-tenant nodes, such as node type, vCPU and memory
 * requirements, node affinity labels, and region.
 *
 * To get more information about NodeTemplate, see:
 *
 * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/nodeTemplates)
 * * How-to Guides
 *     * [Sole-Tenant Nodes](https://cloud.google.com/compute/docs/nodes/)
 *
 * ## Example Usage
 *
 * ### Node Template Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const template = new gcp.compute.NodeTemplate("template", {
 *     name: "soletenant-tmpl",
 *     region: "us-central1",
 *     nodeType: "n1-node-96-624",
 * });
 * ```
 * ### Node Template Server Binding
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const central1a = gcp.compute.getNodeTypes({
 *     zone: "us-central1-a",
 * });
 * const template = new gcp.compute.NodeTemplate("template", {
 *     name: "soletenant-with-licenses",
 *     region: "us-central1",
 *     nodeType: "n1-node-96-624",
 *     nodeAffinityLabels: {
 *         foo: "baz",
 *     },
 *     serverBinding: {
 *         type: "RESTART_NODE_ON_MINIMAL_SERVERS",
 *     },
 * });
 * ```
 * ### Node Template Accelerators
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const central1a = gcp.compute.getNodeTypes({
 *     zone: "us-central1-a",
 * });
 * const template = new gcp.compute.NodeTemplate("template", {
 *     name: "soletenant-with-accelerators",
 *     region: "us-central1",
 *     nodeType: "n1-node-96-624",
 *     accelerators: [{
 *         acceleratorType: "nvidia-tesla-t4",
 *         acceleratorCount: 4,
 *     }],
 * });
 * ```
 * ### Node Template Disks
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const central1a = gcp.compute.getNodeTypes({
 *     zone: "us-central1-a",
 * });
 * const template = new gcp.compute.NodeTemplate("template", {
 *     name: "soletenant-with-disks",
 *     region: "us-central1",
 *     nodeType: "n2-node-80-640",
 *     disks: [{
 *         diskCount: 16,
 *         diskSizeGb: 375,
 *         diskType: "local-ssd",
 *     }],
 * });
 * ```
 *
 * ## Import
 *
 * NodeTemplate can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/regions/{{region}}/nodeTemplates/{{name}}`
 *
 * * `{{project}}/{{region}}/{{name}}`
 *
 * * `{{region}}/{{name}}`
 *
 * * `{{name}}`
 *
 * When using the `pulumi import` command, NodeTemplate can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:compute/nodeTemplate:NodeTemplate default projects/{{project}}/regions/{{region}}/nodeTemplates/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/nodeTemplate:NodeTemplate default {{project}}/{{region}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/nodeTemplate:NodeTemplate default {{region}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/nodeTemplate:NodeTemplate default {{name}}
 * ```
 */
class NodeTemplate extends pulumi.CustomResource {
    /**
     * Get an existing NodeTemplate 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 NodeTemplate(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of NodeTemplate.  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'] === NodeTemplate.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["accelerators"] = state?.accelerators;
            resourceInputs["cpuOvercommitType"] = state?.cpuOvercommitType;
            resourceInputs["creationTimestamp"] = state?.creationTimestamp;
            resourceInputs["description"] = state?.description;
            resourceInputs["disks"] = state?.disks;
            resourceInputs["name"] = state?.name;
            resourceInputs["nodeAffinityLabels"] = state?.nodeAffinityLabels;
            resourceInputs["nodeType"] = state?.nodeType;
            resourceInputs["nodeTypeFlexibility"] = state?.nodeTypeFlexibility;
            resourceInputs["project"] = state?.project;
            resourceInputs["region"] = state?.region;
            resourceInputs["selfLink"] = state?.selfLink;
            resourceInputs["serverBinding"] = state?.serverBinding;
        }
        else {
            const args = argsOrState;
            resourceInputs["accelerators"] = args?.accelerators;
            resourceInputs["cpuOvercommitType"] = args?.cpuOvercommitType;
            resourceInputs["description"] = args?.description;
            resourceInputs["disks"] = args?.disks;
            resourceInputs["name"] = args?.name;
            resourceInputs["nodeAffinityLabels"] = args?.nodeAffinityLabels;
            resourceInputs["nodeType"] = args?.nodeType;
            resourceInputs["nodeTypeFlexibility"] = args?.nodeTypeFlexibility;
            resourceInputs["project"] = args?.project;
            resourceInputs["region"] = args?.region;
            resourceInputs["serverBinding"] = args?.serverBinding;
            resourceInputs["creationTimestamp"] = undefined /*out*/;
            resourceInputs["selfLink"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(NodeTemplate.__pulumiType, name, resourceInputs, opts);
    }
}
exports.NodeTemplate = NodeTemplate;
/** @internal */
NodeTemplate.__pulumiType = 'gcp:compute/nodeTemplate:NodeTemplate';
//# sourceMappingURL=nodeTemplate.js.map