@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
98 lines • 4.29 kB
JavaScript
;
// *** 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");
/**
* Creates a new Amazon Redshift Serverless Snapshot.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.redshiftserverless.Snapshot("example", {
* namespaceName: exampleAwsRedshiftserverlessWorkgroup.namespaceName,
* snapshotName: "example",
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Redshift Serverless Snapshots using the `snapshot_name`. For example:
*
* ```sh
* $ pulumi import aws:redshiftserverless/snapshot:Snapshot example example
* ```
*/
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["accountsWithProvisionedRestoreAccesses"] = state?.accountsWithProvisionedRestoreAccesses;
resourceInputs["accountsWithRestoreAccesses"] = state?.accountsWithRestoreAccesses;
resourceInputs["adminUsername"] = state?.adminUsername;
resourceInputs["arn"] = state?.arn;
resourceInputs["kmsKeyId"] = state?.kmsKeyId;
resourceInputs["namespaceArn"] = state?.namespaceArn;
resourceInputs["namespaceName"] = state?.namespaceName;
resourceInputs["ownerAccount"] = state?.ownerAccount;
resourceInputs["region"] = state?.region;
resourceInputs["retentionPeriod"] = state?.retentionPeriod;
resourceInputs["snapshotName"] = state?.snapshotName;
}
else {
const args = argsOrState;
if (args?.namespaceName === undefined && !opts.urn) {
throw new Error("Missing required property 'namespaceName'");
}
if (args?.snapshotName === undefined && !opts.urn) {
throw new Error("Missing required property 'snapshotName'");
}
resourceInputs["namespaceName"] = args?.namespaceName;
resourceInputs["region"] = args?.region;
resourceInputs["retentionPeriod"] = args?.retentionPeriod;
resourceInputs["snapshotName"] = args?.snapshotName;
resourceInputs["accountsWithProvisionedRestoreAccesses"] = undefined /*out*/;
resourceInputs["accountsWithRestoreAccesses"] = undefined /*out*/;
resourceInputs["adminUsername"] = undefined /*out*/;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["kmsKeyId"] = undefined /*out*/;
resourceInputs["namespaceArn"] = undefined /*out*/;
resourceInputs["ownerAccount"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Snapshot.__pulumiType, name, resourceInputs, opts);
}
}
exports.Snapshot = Snapshot;
/** @internal */
Snapshot.__pulumiType = 'aws:redshiftserverless/snapshot:Snapshot';
//# sourceMappingURL=snapshot.js.map