UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

122 lines 6 kB
"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.SnapshotCopy = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Creates a Snapshot of a snapshot. * * ## 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", * }, * }); * const exampleCopy = new aws.ebs.SnapshotCopy("example_copy", { * sourceSnapshotId: exampleSnapshot.id, * sourceRegion: "us-west-2", * tags: { * Name: "HelloWorld_copy_snap", * }, * }); * ``` */ class SnapshotCopy extends pulumi.CustomResource { /** * Get an existing SnapshotCopy 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 SnapshotCopy(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of SnapshotCopy. 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'] === SnapshotCopy.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state ? state.arn : undefined; resourceInputs["completionDurationMinutes"] = state ? state.completionDurationMinutes : undefined; resourceInputs["dataEncryptionKeyId"] = state ? state.dataEncryptionKeyId : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["encrypted"] = state ? state.encrypted : undefined; resourceInputs["kmsKeyId"] = state ? state.kmsKeyId : undefined; resourceInputs["outpostArn"] = state ? state.outpostArn : undefined; resourceInputs["ownerAlias"] = state ? state.ownerAlias : undefined; resourceInputs["ownerId"] = state ? state.ownerId : undefined; resourceInputs["permanentRestore"] = state ? state.permanentRestore : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["sourceRegion"] = state ? state.sourceRegion : undefined; resourceInputs["sourceSnapshotId"] = state ? state.sourceSnapshotId : undefined; resourceInputs["storageTier"] = state ? state.storageTier : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; resourceInputs["temporaryRestoreDays"] = state ? state.temporaryRestoreDays : undefined; resourceInputs["volumeId"] = state ? state.volumeId : undefined; resourceInputs["volumeSize"] = state ? state.volumeSize : undefined; } else { const args = argsOrState; if ((!args || args.sourceRegion === undefined) && !opts.urn) { throw new Error("Missing required property 'sourceRegion'"); } if ((!args || args.sourceSnapshotId === undefined) && !opts.urn) { throw new Error("Missing required property 'sourceSnapshotId'"); } resourceInputs["completionDurationMinutes"] = args ? args.completionDurationMinutes : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["encrypted"] = args ? args.encrypted : undefined; resourceInputs["kmsKeyId"] = args ? args.kmsKeyId : undefined; resourceInputs["permanentRestore"] = args ? args.permanentRestore : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["sourceRegion"] = args ? args.sourceRegion : undefined; resourceInputs["sourceSnapshotId"] = args ? args.sourceSnapshotId : undefined; resourceInputs["storageTier"] = args ? args.storageTier : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["temporaryRestoreDays"] = args ? args.temporaryRestoreDays : undefined; resourceInputs["arn"] = undefined /*out*/; resourceInputs["dataEncryptionKeyId"] = undefined /*out*/; resourceInputs["outpostArn"] = undefined /*out*/; resourceInputs["ownerAlias"] = undefined /*out*/; resourceInputs["ownerId"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; resourceInputs["volumeId"] = undefined /*out*/; resourceInputs["volumeSize"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(SnapshotCopy.__pulumiType, name, resourceInputs, opts); } } exports.SnapshotCopy = SnapshotCopy; /** @internal */ SnapshotCopy.__pulumiType = 'aws:ebs/snapshotCopy:SnapshotCopy'; //# sourceMappingURL=snapshotCopy.js.map