"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.Snapshot = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Represents a Persistent Disk Snapshot resource.
 *
 * Use snapshots to back up data from your persistent disks. Snapshots are
 * different from public images and custom images, which are used primarily
 * to create instances or configure instance templates. Snapshots are useful
 * for periodic backup of the data on your persistent disks. You can create
 * snapshots from persistent disks even while they are attached to running
 * instances.
 *
 * Snapshots are incremental, so you can create regular snapshots on a
 * persistent disk faster and at a much lower cost than if you regularly
 * created a full image of the disk.
 *
 * To get more information about Snapshot, see:
 *
 * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/snapshots)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/compute/docs/disks/create-snapshots)
 *
 * > **Warning:** All arguments including the following potentially sensitive
 * values will be stored in the raw state as plain text: `snapshot_encryption_key.raw_key`, `snapshot_encryption_key.rsa_encrypted_key`, `source_disk_encryption_key.raw_key`, `source_disk_encryption_key.rsa_encrypted_key`.
 *
 * ## Example Usage
 *
 * ### Snapshot Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const debian = gcp.compute.getImage({
 *     family: "debian-11",
 *     project: "debian-cloud",
 * });
 * const persistent = new gcp.compute.Disk("persistent", {
 *     name: "debian-disk",
 *     image: debian.then(debian => debian.selfLink),
 *     size: 10,
 *     type: "pd-ssd",
 *     zone: "us-central1-a",
 * });
 * const snapshot = new gcp.compute.Snapshot("snapshot", {
 *     name: "my-snapshot",
 *     sourceDisk: persistent.id,
 *     zone: "us-central1-a",
 *     labels: {
 *         my_label: "value",
 *     },
 *     storageLocations: ["us-central1"],
 * });
 * ```
 * ### Snapshot Basic2
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const debian = gcp.compute.getImage({
 *     family: "debian-11",
 *     project: "debian-cloud",
 * });
 * const persistent = new gcp.compute.Disk("persistent", {
 *     name: "debian-disk",
 *     image: debian.then(debian => debian.selfLink),
 *     size: 10,
 *     type: "pd-ssd",
 *     zone: "us-central1-a",
 * });
 * const snapshot = new gcp.compute.Snapshot("snapshot", {
 *     name: "my-snapshot",
 *     sourceDisk: persistent.id,
 *     zone: "us-central1-a",
 *     labels: {
 *         my_label: "value",
 *     },
 *     storageLocations: ["us-central1"],
 *     guestFlush: true,
 * });
 * ```
 * ### Snapshot Basic Source Instant Snapshot
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const debian = gcp.compute.getImage({
 *     family: "debian-11",
 *     project: "debian-cloud",
 * });
 * const persistent = new gcp.compute.Disk("persistent", {
 *     name: "debian-disk",
 *     image: debian.then(debian => debian.selfLink),
 *     size: 10,
 *     type: "pd-ssd",
 *     zone: "us-central1-a",
 * });
 * const instantSnapshot = new gcp.compute.InstantSnapshot("instant_snapshot", {
 *     name: "my-instant-snapshot",
 *     sourceDisk: persistent.selfLink,
 *     zone: persistent.zone,
 *     description: "A test snapshot",
 *     labels: {
 *         foo: "bar",
 *     },
 * });
 * const snapshot = new gcp.compute.Snapshot("snapshot", {
 *     name: "my-snapshot",
 *     zone: "us-central1-a",
 *     sourceInstantSnapshot: instantSnapshot.id,
 * });
 * ```
 * ### Snapshot Chainname
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const debian = gcp.compute.getImage({
 *     family: "debian-11",
 *     project: "debian-cloud",
 * });
 * const persistent = new gcp.compute.Disk("persistent", {
 *     name: "debian-disk",
 *     image: debian.then(debian => debian.selfLink),
 *     size: 10,
 *     type: "pd-ssd",
 *     zone: "us-central1-a",
 * });
 * const snapshot = new gcp.compute.Snapshot("snapshot", {
 *     name: "my-snapshot",
 *     sourceDisk: persistent.id,
 *     zone: "us-central1-a",
 *     chainName: "snapshot-chain",
 *     labels: {
 *         my_label: "value",
 *     },
 *     storageLocations: ["us-central1"],
 * });
 * ```
 *
 * ## Import
 *
 * Snapshot can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/global/snapshots/{{name}}`
 *
 * * `{{project}}/{{name}}`
 *
 * * `{{name}}`
 *
 * When using the `pulumi import` command, Snapshot can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:compute/snapshot:Snapshot default projects/{{project}}/global/snapshots/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/snapshot:Snapshot default {{project}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/snapshot:Snapshot default {{name}}
 * ```
 */
class Snapshot extends pulumi.CustomResource {
    /**
     * Get an existing Snapshot 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 Snapshot(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of Snapshot.  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'] === Snapshot.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["chainName"] = state?.chainName;
            resourceInputs["creationTimestamp"] = state?.creationTimestamp;
            resourceInputs["description"] = state?.description;
            resourceInputs["diskSizeGb"] = state?.diskSizeGb;
            resourceInputs["effectiveLabels"] = state?.effectiveLabels;
            resourceInputs["guestFlush"] = state?.guestFlush;
            resourceInputs["labelFingerprint"] = state?.labelFingerprint;
            resourceInputs["labels"] = state?.labels;
            resourceInputs["licenses"] = state?.licenses;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["pulumiLabels"] = state?.pulumiLabels;
            resourceInputs["selfLink"] = state?.selfLink;
            resourceInputs["snapshotEncryptionKey"] = state?.snapshotEncryptionKey;
            resourceInputs["snapshotId"] = state?.snapshotId;
            resourceInputs["snapshotType"] = state?.snapshotType;
            resourceInputs["sourceDisk"] = state?.sourceDisk;
            resourceInputs["sourceDiskEncryptionKey"] = state?.sourceDiskEncryptionKey;
            resourceInputs["sourceInstantSnapshot"] = state?.sourceInstantSnapshot;
            resourceInputs["storageBytes"] = state?.storageBytes;
            resourceInputs["storageLocations"] = state?.storageLocations;
            resourceInputs["zone"] = state?.zone;
        }
        else {
            const args = argsOrState;
            resourceInputs["chainName"] = args?.chainName;
            resourceInputs["description"] = args?.description;
            resourceInputs["guestFlush"] = args?.guestFlush;
            resourceInputs["labels"] = args?.labels;
            resourceInputs["name"] = args?.name;
            resourceInputs["project"] = args?.project;
            resourceInputs["snapshotEncryptionKey"] = args?.snapshotEncryptionKey;
            resourceInputs["snapshotType"] = args?.snapshotType;
            resourceInputs["sourceDisk"] = args?.sourceDisk;
            resourceInputs["sourceDiskEncryptionKey"] = args?.sourceDiskEncryptionKey;
            resourceInputs["sourceInstantSnapshot"] = args?.sourceInstantSnapshot;
            resourceInputs["storageLocations"] = args?.storageLocations;
            resourceInputs["zone"] = args?.zone;
            resourceInputs["creationTimestamp"] = undefined /*out*/;
            resourceInputs["diskSizeGb"] = undefined /*out*/;
            resourceInputs["effectiveLabels"] = undefined /*out*/;
            resourceInputs["labelFingerprint"] = undefined /*out*/;
            resourceInputs["licenses"] = undefined /*out*/;
            resourceInputs["pulumiLabels"] = undefined /*out*/;
            resourceInputs["selfLink"] = undefined /*out*/;
            resourceInputs["snapshotId"] = undefined /*out*/;
            resourceInputs["storageBytes"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(Snapshot.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Snapshot = Snapshot;
/** @internal */
Snapshot.__pulumiType = 'gcp:compute/snapshot:Snapshot';
//# sourceMappingURL=snapshot.js.map