UNPKG

@pulumi/aws

Version:

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

142 lines 6.84 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, { ...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?.allocatedStorage; resourceInputs["availabilityZone"] = state?.availabilityZone; resourceInputs["copyTags"] = state?.copyTags; resourceInputs["dbSnapshotArn"] = state?.dbSnapshotArn; resourceInputs["destinationRegion"] = state?.destinationRegion; resourceInputs["encrypted"] = state?.encrypted; resourceInputs["engine"] = state?.engine; resourceInputs["engineVersion"] = state?.engineVersion; resourceInputs["iops"] = state?.iops; resourceInputs["kmsKeyId"] = state?.kmsKeyId; resourceInputs["licenseModel"] = state?.licenseModel; resourceInputs["optionGroupName"] = state?.optionGroupName; resourceInputs["port"] = state?.port; resourceInputs["presignedUrl"] = state?.presignedUrl; resourceInputs["region"] = state?.region; resourceInputs["sharedAccounts"] = state?.sharedAccounts; resourceInputs["snapshotType"] = state?.snapshotType; resourceInputs["sourceDbSnapshotIdentifier"] = state?.sourceDbSnapshotIdentifier; resourceInputs["sourceRegion"] = state?.sourceRegion; resourceInputs["storageType"] = state?.storageType; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["targetCustomAvailabilityZone"] = state?.targetCustomAvailabilityZone; resourceInputs["targetDbSnapshotIdentifier"] = state?.targetDbSnapshotIdentifier; resourceInputs["vpcId"] = state?.vpcId; } else { const args = argsOrState; if (args?.sourceDbSnapshotIdentifier === undefined && !opts.urn) { throw new Error("Missing required property 'sourceDbSnapshotIdentifier'"); } if (args?.targetDbSnapshotIdentifier === undefined && !opts.urn) { throw new Error("Missing required property 'targetDbSnapshotIdentifier'"); } resourceInputs["copyTags"] = args?.copyTags; resourceInputs["destinationRegion"] = args?.destinationRegion; resourceInputs["kmsKeyId"] = args?.kmsKeyId; resourceInputs["optionGroupName"] = args?.optionGroupName; resourceInputs["presignedUrl"] = args?.presignedUrl; resourceInputs["region"] = args?.region; resourceInputs["sharedAccounts"] = args?.sharedAccounts; resourceInputs["sourceDbSnapshotIdentifier"] = args?.sourceDbSnapshotIdentifier; resourceInputs["tags"] = args?.tags; resourceInputs["targetCustomAvailabilityZone"] = args?.targetCustomAvailabilityZone; resourceInputs["targetDbSnapshotIdentifier"] = args?.targetDbSnapshotIdentifier; 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