@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
113 lines • 4.76 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.TableReplica = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a DynamoDB table replica resource for [DynamoDB Global Tables V2 (version 2019.11.21)](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/globaltables.V2.html).
*
* > **Note:** Use `lifecycle` `ignoreChanges` for `replica` in the associated aws.dynamodb.Table configuration.
*
* > **Note:** Do not use the `replica` configuration block of aws.dynamodb.Table together with this resource as the two configuration options are mutually exclusive.
*
* ## Example Usage
*
* ### Basic Example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.dynamodb.Table("example", {
* name: "TestTable",
* hashKey: "BrodoBaggins",
* billingMode: "PAY_PER_REQUEST",
* streamEnabled: true,
* streamViewType: "NEW_AND_OLD_IMAGES",
* attributes: [{
* name: "BrodoBaggins",
* type: "S",
* }],
* });
* const exampleTableReplica = new aws.dynamodb.TableReplica("example", {
* globalTableArn: example.arn,
* tags: {
* Name: "IZPAWS",
* Pozo: "Amargo",
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import DynamoDB table replicas using the `table-name:main-region`. For example:
*
* ~> __Note:__ When importing, use the region where the initial or _main_ global table resides, _not_ the region of the replica.
*
* ```sh
* $ pulumi import aws:dynamodb/tableReplica:TableReplica example TestTable:us-west-2
* ```
*/
class TableReplica extends pulumi.CustomResource {
/**
* Get an existing TableReplica 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 TableReplica(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of TableReplica. 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'] === TableReplica.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["deletionProtectionEnabled"] = state?.deletionProtectionEnabled;
resourceInputs["globalTableArn"] = state?.globalTableArn;
resourceInputs["kmsKeyArn"] = state?.kmsKeyArn;
resourceInputs["pointInTimeRecovery"] = state?.pointInTimeRecovery;
resourceInputs["region"] = state?.region;
resourceInputs["tableClassOverride"] = state?.tableClassOverride;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
}
else {
const args = argsOrState;
if (args?.globalTableArn === undefined && !opts.urn) {
throw new Error("Missing required property 'globalTableArn'");
}
resourceInputs["deletionProtectionEnabled"] = args?.deletionProtectionEnabled;
resourceInputs["globalTableArn"] = args?.globalTableArn;
resourceInputs["kmsKeyArn"] = args?.kmsKeyArn;
resourceInputs["pointInTimeRecovery"] = args?.pointInTimeRecovery;
resourceInputs["region"] = args?.region;
resourceInputs["tableClassOverride"] = args?.tableClassOverride;
resourceInputs["tags"] = args?.tags;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(TableReplica.__pulumiType, name, resourceInputs, opts);
}
}
exports.TableReplica = TableReplica;
/** @internal */
TableReplica.__pulumiType = 'aws:dynamodb/tableReplica:TableReplica';
//# sourceMappingURL=tableReplica.js.map