@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
114 lines • 4.68 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! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.Snapshot = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Creates a Snapshot of an EBS Volume.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.ebs.Volume("example", {
* availabilityZone: "us-west-2a",
* size: 40,
* tags: {
* Name: "HelloWorld",
* },
* });
* const exampleSnapshot = new aws.ebs.Snapshot("example_snapshot", {
* volumeId: example.id,
* tags: {
* Name: "HelloWorld_snap",
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import EBS Snapshot using the `id`. For example:
*
* ```sh
* $ pulumi import aws:ebs/snapshot:Snapshot id snap-049df61146c4d7901
* ```
*/
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["arn"] = state?.arn;
resourceInputs["dataEncryptionKeyId"] = state?.dataEncryptionKeyId;
resourceInputs["description"] = state?.description;
resourceInputs["encrypted"] = state?.encrypted;
resourceInputs["kmsKeyId"] = state?.kmsKeyId;
resourceInputs["outpostArn"] = state?.outpostArn;
resourceInputs["ownerAlias"] = state?.ownerAlias;
resourceInputs["ownerId"] = state?.ownerId;
resourceInputs["permanentRestore"] = state?.permanentRestore;
resourceInputs["region"] = state?.region;
resourceInputs["storageTier"] = state?.storageTier;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["temporaryRestoreDays"] = state?.temporaryRestoreDays;
resourceInputs["volumeId"] = state?.volumeId;
resourceInputs["volumeSize"] = state?.volumeSize;
}
else {
const args = argsOrState;
if (args?.volumeId === undefined && !opts.urn) {
throw new Error("Missing required property 'volumeId'");
}
resourceInputs["description"] = args?.description;
resourceInputs["outpostArn"] = args?.outpostArn;
resourceInputs["permanentRestore"] = args?.permanentRestore;
resourceInputs["region"] = args?.region;
resourceInputs["storageTier"] = args?.storageTier;
resourceInputs["tags"] = args?.tags;
resourceInputs["temporaryRestoreDays"] = args?.temporaryRestoreDays;
resourceInputs["volumeId"] = args?.volumeId;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["dataEncryptionKeyId"] = undefined /*out*/;
resourceInputs["encrypted"] = undefined /*out*/;
resourceInputs["kmsKeyId"] = undefined /*out*/;
resourceInputs["ownerAlias"] = undefined /*out*/;
resourceInputs["ownerId"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
resourceInputs["volumeSize"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Snapshot.__pulumiType, name, resourceInputs, opts);
}
}
exports.Snapshot = Snapshot;
/** @internal */
Snapshot.__pulumiType = 'aws:ebs/snapshot:Snapshot';
//# sourceMappingURL=snapshot.js.map
;