UNPKG

@pulumi/aws

Version:

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

122 lines 5.39 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, { ...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?.arn; resourceInputs["completionDurationMinutes"] = state?.completionDurationMinutes; 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["sourceRegion"] = state?.sourceRegion; resourceInputs["sourceSnapshotId"] = state?.sourceSnapshotId; 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?.sourceRegion === undefined && !opts.urn) { throw new Error("Missing required property 'sourceRegion'"); } if (args?.sourceSnapshotId === undefined && !opts.urn) { throw new Error("Missing required property 'sourceSnapshotId'"); } resourceInputs["completionDurationMinutes"] = args?.completionDurationMinutes; resourceInputs["description"] = args?.description; resourceInputs["encrypted"] = args?.encrypted; resourceInputs["kmsKeyId"] = args?.kmsKeyId; resourceInputs["permanentRestore"] = args?.permanentRestore; resourceInputs["region"] = args?.region; resourceInputs["sourceRegion"] = args?.sourceRegion; resourceInputs["sourceSnapshotId"] = args?.sourceSnapshotId; resourceInputs["storageTier"] = args?.storageTier; resourceInputs["tags"] = args?.tags; resourceInputs["temporaryRestoreDays"] = args?.temporaryRestoreDays; 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