UNPKG

@pulumi/aws

Version:

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

134 lines 6.74 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, Object.assign(Object.assign({}, 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 ? state.allocatedStorage : undefined; resourceInputs["availabilityZone"] = state ? state.availabilityZone : undefined; resourceInputs["dbInstanceIdentifier"] = state ? state.dbInstanceIdentifier : undefined; resourceInputs["dbSnapshotArn"] = state ? state.dbSnapshotArn : undefined; resourceInputs["dbSnapshotIdentifier"] = state ? state.dbSnapshotIdentifier : 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["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["status"] = state ? state.status : undefined; resourceInputs["storageType"] = state ? state.storageType : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; resourceInputs["vpcId"] = state ? state.vpcId : undefined; } else { const args = argsOrState; if ((!args || args.dbInstanceIdentifier === undefined) && !opts.urn) { throw new Error("Missing required property 'dbInstanceIdentifier'"); } if ((!args || args.dbSnapshotIdentifier === undefined) && !opts.urn) { throw new Error("Missing required property 'dbSnapshotIdentifier'"); } resourceInputs["dbInstanceIdentifier"] = args ? args.dbInstanceIdentifier : undefined; resourceInputs["dbSnapshotIdentifier"] = args ? args.dbSnapshotIdentifier : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["sharedAccounts"] = args ? args.sharedAccounts : undefined; resourceInputs["tags"] = args ? args.tags : 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["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