@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
173 lines • 8.15 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.RegionInstantSnapshot = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
* Represents an instant snapshot resource.
*
* An instant snapshot is an in-place backup of a disk that can be used to rapidly create a new disk in minutes.
*
* Instant snapshots capture data at a specific point in time. They are optimized for rapidly restoring captured
* data to a new disk. Use instant snapshots to quickly recover data in cases where the zone and disk are still intact
* but the data on the disk has been lost or corrupted
*
* To get more information about RegionInstantSnapshot, see:
*
* * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/regionInstantSnapshots)
* * How-to Guides
* * [Official Documentation](https://cloud.google.com/compute/docs/disks/instant-snapshots)
*
* ## Example Usage
*
* ### Region Instant Snapshot Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const foo = new gcp.compute.RegionDisk("foo", {
* name: "example-disk",
* type: "pd-ssd",
* region: "us-central1",
* size: 10,
* replicaZones: [
* "us-central1-a",
* "us-central1-f",
* ],
* });
* const _default = new gcp.compute.RegionInstantSnapshot("default", {
* name: "instant-snapshot",
* region: "us-central1",
* sourceDisk: foo.selfLink,
* });
* ```
*
* ## Import
*
* RegionInstantSnapshot can be imported using any of these accepted formats:
*
* * `projects/{{project}}/regions/{{region}}/instantSnapshots/{{name}}`
* * `{{project}}/{{region}}/{{name}}`
* * `{{region}}/{{name}}`
* * `{{name}}`
*
* When using the `pulumi import` command, RegionInstantSnapshot can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:compute/regionInstantSnapshot:RegionInstantSnapshot default projects/{{project}}/regions/{{region}}/instantSnapshots/{{name}}
* $ pulumi import gcp:compute/regionInstantSnapshot:RegionInstantSnapshot default {{project}}/{{region}}/{{name}}
* $ pulumi import gcp:compute/regionInstantSnapshot:RegionInstantSnapshot default {{region}}/{{name}}
* $ pulumi import gcp:compute/regionInstantSnapshot:RegionInstantSnapshot default {{name}}
* ```
*/
class RegionInstantSnapshot extends pulumi.CustomResource {
/**
* Get an existing RegionInstantSnapshot 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 RegionInstantSnapshot(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'gcp:compute/regionInstantSnapshot:RegionInstantSnapshot';
/**
* Returns true if the given object is an instance of RegionInstantSnapshot. 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'] === RegionInstantSnapshot.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["architecture"] = state?.architecture;
resourceInputs["creationTimestamp"] = state?.creationTimestamp;
resourceInputs["deletionPolicy"] = state?.deletionPolicy;
resourceInputs["description"] = state?.description;
resourceInputs["diskSizeGb"] = state?.diskSizeGb;
resourceInputs["effectiveLabels"] = state?.effectiveLabels;
resourceInputs["labelFingerprint"] = state?.labelFingerprint;
resourceInputs["labels"] = state?.labels;
resourceInputs["name"] = state?.name;
resourceInputs["params"] = state?.params;
resourceInputs["project"] = state?.project;
resourceInputs["pulumiLabels"] = state?.pulumiLabels;
resourceInputs["region"] = state?.region;
resourceInputs["resourceStatuses"] = state?.resourceStatuses;
resourceInputs["selfLink"] = state?.selfLink;
resourceInputs["sourceDisk"] = state?.sourceDisk;
resourceInputs["sourceDiskId"] = state?.sourceDiskId;
resourceInputs["sourceInstantSnapshotGroup"] = state?.sourceInstantSnapshotGroup;
resourceInputs["sourceInstantSnapshotGroupId"] = state?.sourceInstantSnapshotGroupId;
resourceInputs["status"] = state?.status;
}
else {
const args = argsOrState;
if (args?.sourceDisk === undefined && !opts.urn) {
throw new Error("Missing required property 'sourceDisk'");
}
resourceInputs["deletionPolicy"] = args?.deletionPolicy;
resourceInputs["description"] = args?.description;
resourceInputs["labels"] = args?.labels;
resourceInputs["name"] = args?.name;
resourceInputs["params"] = args?.params;
resourceInputs["project"] = args?.project;
resourceInputs["region"] = args?.region;
resourceInputs["sourceDisk"] = args?.sourceDisk;
resourceInputs["architecture"] = undefined /*out*/;
resourceInputs["creationTimestamp"] = undefined /*out*/;
resourceInputs["diskSizeGb"] = undefined /*out*/;
resourceInputs["effectiveLabels"] = undefined /*out*/;
resourceInputs["labelFingerprint"] = undefined /*out*/;
resourceInputs["pulumiLabels"] = undefined /*out*/;
resourceInputs["resourceStatuses"] = undefined /*out*/;
resourceInputs["selfLink"] = undefined /*out*/;
resourceInputs["sourceDiskId"] = undefined /*out*/;
resourceInputs["sourceInstantSnapshotGroup"] = undefined /*out*/;
resourceInputs["sourceInstantSnapshotGroupId"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(RegionInstantSnapshot.__pulumiType, name, resourceInputs, opts);
}
}
exports.RegionInstantSnapshot = RegionInstantSnapshot;
//# sourceMappingURL=regionInstantSnapshot.js.map