UNPKG

@pulumi/aws

Version:

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

134 lines 6.16 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.Snapshot = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an RDS database instance snapshot. 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 bar = new aws.rds.Instance("bar", { * 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 test = new aws.rds.Snapshot("test", { * dbInstanceIdentifier: bar.identifier, * dbSnapshotIdentifier: "testsnapshot1234", * }); * ``` * * ## Import * * Using `pulumi import`, import `aws_db_snapshot` using the snapshot identifier. For example: * * ```sh * $ pulumi import aws:rds/snapshot:Snapshot example my-snapshot * ``` */ 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["allocatedStorage"] = state?.allocatedStorage; resourceInputs["availabilityZone"] = state?.availabilityZone; resourceInputs["dbInstanceIdentifier"] = state?.dbInstanceIdentifier; resourceInputs["dbSnapshotArn"] = state?.dbSnapshotArn; resourceInputs["dbSnapshotIdentifier"] = state?.dbSnapshotIdentifier; 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["region"] = state?.region; resourceInputs["sharedAccounts"] = state?.sharedAccounts; resourceInputs["snapshotType"] = state?.snapshotType; resourceInputs["sourceDbSnapshotIdentifier"] = state?.sourceDbSnapshotIdentifier; resourceInputs["sourceRegion"] = state?.sourceRegion; resourceInputs["status"] = state?.status; resourceInputs["storageType"] = state?.storageType; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["vpcId"] = state?.vpcId; } else { const args = argsOrState; if (args?.dbInstanceIdentifier === undefined && !opts.urn) { throw new Error("Missing required property 'dbInstanceIdentifier'"); } if (args?.dbSnapshotIdentifier === undefined && !opts.urn) { throw new Error("Missing required property 'dbSnapshotIdentifier'"); } resourceInputs["dbInstanceIdentifier"] = args?.dbInstanceIdentifier; resourceInputs["dbSnapshotIdentifier"] = args?.dbSnapshotIdentifier; resourceInputs["region"] = args?.region; resourceInputs["sharedAccounts"] = args?.sharedAccounts; resourceInputs["tags"] = args?.tags; 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["kmsKeyId"] = undefined /*out*/; resourceInputs["licenseModel"] = undefined /*out*/; resourceInputs["optionGroupName"] = undefined /*out*/; resourceInputs["port"] = undefined /*out*/; resourceInputs["snapshotType"] = undefined /*out*/; resourceInputs["sourceDbSnapshotIdentifier"] = undefined /*out*/; resourceInputs["sourceRegion"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["storageType"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; resourceInputs["vpcId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Snapshot.__pulumiType, name, resourceInputs, opts); } } exports.Snapshot = Snapshot; /** @internal */ Snapshot.__pulumiType = 'aws:rds/snapshot:Snapshot'; //# sourceMappingURL=snapshot.js.map