@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
113 lines • 5.1 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, Object.assign(Object.assign({}, 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 ? state.arn : undefined;
resourceInputs["deletionProtectionEnabled"] = state ? state.deletionProtectionEnabled : undefined;
resourceInputs["globalTableArn"] = state ? state.globalTableArn : undefined;
resourceInputs["kmsKeyArn"] = state ? state.kmsKeyArn : undefined;
resourceInputs["pointInTimeRecovery"] = state ? state.pointInTimeRecovery : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["tableClassOverride"] = state ? state.tableClassOverride : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
}
else {
const args = argsOrState;
if ((!args || args.globalTableArn === undefined) && !opts.urn) {
throw new Error("Missing required property 'globalTableArn'");
}
resourceInputs["deletionProtectionEnabled"] = args ? args.deletionProtectionEnabled : undefined;
resourceInputs["globalTableArn"] = args ? args.globalTableArn : undefined;
resourceInputs["kmsKeyArn"] = args ? args.kmsKeyArn : undefined;
resourceInputs["pointInTimeRecovery"] = args ? args.pointInTimeRecovery : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["tableClassOverride"] = args ? args.tableClassOverride : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
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