"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.Instance = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A Managed Lustre instance
 *
 * To get more information about Instance, see:
 *
 * * [API documentation](https://cloud.google.com/managed-lustre/docs/reference/rest/v1/projects.locations.instances)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/managed-lustre/docs/create-instance)
 *
 * ## Example Usage
 *
 * ### Lustre Instance Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * // This example assumes this network already exists.
 * // The API creates a tenant network per network authorized for a
 * // Lustre instance and that network is not deleted when the user-created
 * // network (authorized_network) is deleted, so this prevents issues
 * // with tenant network quota.
 * // If this network hasn't been created and you are using this example in your
 * // config, add an additional network resource or change
 * // this from "data"to "resource"
 * const lustre_network = gcp.compute.getNetwork({
 *     name: "my-network",
 * });
 * const instance = new gcp.lustre.Instance("instance", {
 *     instanceId: "my-instance",
 *     location: "us-central1-a",
 *     description: "test lustre instance",
 *     filesystem: "testfs",
 *     capacityGib: "18000",
 *     network: lustre_network.then(lustre_network => lustre_network.id),
 *     perUnitStorageThroughput: "1000",
 *     labels: {
 *         test: "value",
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * Instance can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{location}}/instances/{{instance_id}}`
 *
 * * `{{project}}/{{location}}/{{instance_id}}`
 *
 * * `{{location}}/{{instance_id}}`
 *
 * When using the `pulumi import` command, Instance can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:lustre/instance:Instance default projects/{{project}}/locations/{{location}}/instances/{{instance_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:lustre/instance:Instance default {{project}}/{{location}}/{{instance_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:lustre/instance:Instance default {{location}}/{{instance_id}}
 * ```
 */
class Instance extends pulumi.CustomResource {
    /**
     * Get an existing Instance 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 Instance(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of Instance.  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'] === Instance.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["accessRulesOptions"] = state?.accessRulesOptions;
            resourceInputs["capacityGib"] = state?.capacityGib;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["description"] = state?.description;
            resourceInputs["effectiveLabels"] = state?.effectiveLabels;
            resourceInputs["filesystem"] = state?.filesystem;
            resourceInputs["gkeSupportEnabled"] = state?.gkeSupportEnabled;
            resourceInputs["instanceId"] = state?.instanceId;
            resourceInputs["kmsKey"] = state?.kmsKey;
            resourceInputs["labels"] = state?.labels;
            resourceInputs["location"] = state?.location;
            resourceInputs["mountPoint"] = state?.mountPoint;
            resourceInputs["name"] = state?.name;
            resourceInputs["network"] = state?.network;
            resourceInputs["perUnitStorageThroughput"] = state?.perUnitStorageThroughput;
            resourceInputs["placementPolicy"] = state?.placementPolicy;
            resourceInputs["project"] = state?.project;
            resourceInputs["pulumiLabels"] = state?.pulumiLabels;
            resourceInputs["state"] = state?.state;
            resourceInputs["stateReason"] = state?.stateReason;
            resourceInputs["updateTime"] = state?.updateTime;
        }
        else {
            const args = argsOrState;
            if (args?.capacityGib === undefined && !opts.urn) {
                throw new Error("Missing required property 'capacityGib'");
            }
            if (args?.filesystem === undefined && !opts.urn) {
                throw new Error("Missing required property 'filesystem'");
            }
            if (args?.instanceId === undefined && !opts.urn) {
                throw new Error("Missing required property 'instanceId'");
            }
            if (args?.location === undefined && !opts.urn) {
                throw new Error("Missing required property 'location'");
            }
            if (args?.network === undefined && !opts.urn) {
                throw new Error("Missing required property 'network'");
            }
            if (args?.perUnitStorageThroughput === undefined && !opts.urn) {
                throw new Error("Missing required property 'perUnitStorageThroughput'");
            }
            resourceInputs["accessRulesOptions"] = args?.accessRulesOptions;
            resourceInputs["capacityGib"] = args?.capacityGib;
            resourceInputs["description"] = args?.description;
            resourceInputs["filesystem"] = args?.filesystem;
            resourceInputs["gkeSupportEnabled"] = args?.gkeSupportEnabled;
            resourceInputs["instanceId"] = args?.instanceId;
            resourceInputs["kmsKey"] = args?.kmsKey;
            resourceInputs["labels"] = args?.labels;
            resourceInputs["location"] = args?.location;
            resourceInputs["network"] = args?.network;
            resourceInputs["perUnitStorageThroughput"] = args?.perUnitStorageThroughput;
            resourceInputs["placementPolicy"] = args?.placementPolicy;
            resourceInputs["project"] = args?.project;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["effectiveLabels"] = undefined /*out*/;
            resourceInputs["mountPoint"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["pulumiLabels"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
            resourceInputs["stateReason"] = undefined /*out*/;
            resourceInputs["updateTime"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(Instance.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Instance = Instance;
/** @internal */
Instance.__pulumiType = 'gcp:lustre/instance:Instance';
//# sourceMappingURL=instance.js.map