UNPKG

@pulumi/aws

Version:

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

142 lines 7.57 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"); /** * Manages an RDS database instance snapshot copy. For managing RDS database cluster snapshots, see the `aws.rds.ClusterSnapshot` resource. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.rds.Instance("example", { * allocatedStorage: 10, * engine: "mysql", * engineVersion: "5.6.21", * instanceClass: aws.rds.InstanceType.T2_Micro, * dbName: "baz", * password: "barbarbarbar", * username: "foo", * maintenanceWindow: "Fri:09:00-Fri:09:30", * backupRetentionPeriod: 0, * parameterGroupName: "default.mysql5.6", * }); * const exampleSnapshot = new aws.rds.Snapshot("example", { * dbInstanceIdentifier: example.identifier, * dbSnapshotIdentifier: "testsnapshot1234", * }); * const exampleSnapshotCopy = new aws.rds.SnapshotCopy("example", { * sourceDbSnapshotIdentifier: exampleSnapshot.dbSnapshotArn, * targetDbSnapshotIdentifier: "testsnapshot1234-copy", * }); * ``` * * ## Import * * Using `pulumi import`, import `aws_db_snapshot_copy` using the snapshot identifier. For example: * * ```sh * $ pulumi import aws:rds/snapshotCopy:SnapshotCopy example my-snapshot * ``` */ 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["allocatedStorage"] = state ? state.allocatedStorage : undefined; resourceInputs["availabilityZone"] = state ? state.availabilityZone : undefined; resourceInputs["copyTags"] = state ? state.copyTags : undefined; resourceInputs["dbSnapshotArn"] = state ? state.dbSnapshotArn : undefined; resourceInputs["destinationRegion"] = state ? state.destinationRegion : undefined; resourceInputs["encrypted"] = state ? state.encrypted : undefined; resourceInputs["engine"] = state ? state.engine : undefined; resourceInputs["engineVersion"] = state ? state.engineVersion : undefined; resourceInputs["iops"] = state ? state.iops : undefined; resourceInputs["kmsKeyId"] = state ? state.kmsKeyId : undefined; resourceInputs["licenseModel"] = state ? state.licenseModel : undefined; resourceInputs["optionGroupName"] = state ? state.optionGroupName : undefined; resourceInputs["port"] = state ? state.port : undefined; resourceInputs["presignedUrl"] = state ? state.presignedUrl : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["sharedAccounts"] = state ? state.sharedAccounts : undefined; resourceInputs["snapshotType"] = state ? state.snapshotType : undefined; resourceInputs["sourceDbSnapshotIdentifier"] = state ? state.sourceDbSnapshotIdentifier : undefined; resourceInputs["sourceRegion"] = state ? state.sourceRegion : undefined; resourceInputs["storageType"] = state ? state.storageType : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; resourceInputs["targetCustomAvailabilityZone"] = state ? state.targetCustomAvailabilityZone : undefined; resourceInputs["targetDbSnapshotIdentifier"] = state ? state.targetDbSnapshotIdentifier : undefined; resourceInputs["vpcId"] = state ? state.vpcId : undefined; } else { const args = argsOrState; if ((!args || args.sourceDbSnapshotIdentifier === undefined) && !opts.urn) { throw new Error("Missing required property 'sourceDbSnapshotIdentifier'"); } if ((!args || args.targetDbSnapshotIdentifier === undefined) && !opts.urn) { throw new Error("Missing required property 'targetDbSnapshotIdentifier'"); } resourceInputs["copyTags"] = args ? args.copyTags : undefined; resourceInputs["destinationRegion"] = args ? args.destinationRegion : undefined; resourceInputs["kmsKeyId"] = args ? args.kmsKeyId : undefined; resourceInputs["optionGroupName"] = args ? args.optionGroupName : undefined; resourceInputs["presignedUrl"] = args ? args.presignedUrl : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["sharedAccounts"] = args ? args.sharedAccounts : undefined; resourceInputs["sourceDbSnapshotIdentifier"] = args ? args.sourceDbSnapshotIdentifier : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["targetCustomAvailabilityZone"] = args ? args.targetCustomAvailabilityZone : undefined; resourceInputs["targetDbSnapshotIdentifier"] = args ? args.targetDbSnapshotIdentifier : undefined; resourceInputs["allocatedStorage"] = undefined /*out*/; resourceInputs["availabilityZone"] = undefined /*out*/; resourceInputs["dbSnapshotArn"] = undefined /*out*/; resourceInputs["encrypted"] = undefined /*out*/; resourceInputs["engine"] = undefined /*out*/; resourceInputs["engineVersion"] = undefined /*out*/; resourceInputs["iops"] = undefined /*out*/; resourceInputs["licenseModel"] = undefined /*out*/; resourceInputs["port"] = undefined /*out*/; resourceInputs["snapshotType"] = undefined /*out*/; resourceInputs["sourceRegion"] = undefined /*out*/; resourceInputs["storageType"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; resourceInputs["vpcId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(SnapshotCopy.__pulumiType, name, resourceInputs, opts); } } exports.SnapshotCopy = SnapshotCopy; /** @internal */ SnapshotCopy.__pulumiType = 'aws:rds/snapshotCopy:SnapshotCopy'; //# sourceMappingURL=snapshotCopy.js.map