@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
146 lines (145 loc) • 5.65 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* Manages [DynamoDB Global Tables V1 (version 2017.11.29)](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/globaltables.V1.html). These are layered on top of existing DynamoDB Tables.
*
* > **NOTE:** To instead manage [DynamoDB Global Tables V2 (version 2019.11.21)](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/globaltables.V2.html), use the `aws.dynamodb.Table` resource `replica` configuration block.
*
* > Note: There are many restrictions before you can properly create DynamoDB Global Tables in multiple regions. See the [AWS DynamoDB Global Table Requirements](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/globaltables_reqs_bestpractices.html) for more information.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const us_east_1 = new aws.dynamodb.Table("us-east-1", {
* hashKey: "myAttribute",
* name: "myTable",
* streamEnabled: true,
* streamViewType: "NEW_AND_OLD_IMAGES",
* readCapacity: 1,
* writeCapacity: 1,
* attributes: [{
* name: "myAttribute",
* type: "S",
* }],
* });
* const us_west_2 = new aws.dynamodb.Table("us-west-2", {
* hashKey: "myAttribute",
* name: "myTable",
* streamEnabled: true,
* streamViewType: "NEW_AND_OLD_IMAGES",
* readCapacity: 1,
* writeCapacity: 1,
* attributes: [{
* name: "myAttribute",
* type: "S",
* }],
* });
* const myTable = new aws.dynamodb.GlobalTable("myTable", {
* name: "myTable",
* replicas: [
* {
* regionName: "us-east-1",
* },
* {
* regionName: "us-west-2",
* },
* ],
* }, {
* dependsOn: [
* us_east_1,
* us_west_2,
* ],
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import DynamoDB Global Tables using the global table name. For example:
*
* ```sh
* $ pulumi import aws:dynamodb/globalTable:GlobalTable MyTable MyTable
* ```
*/
export declare class GlobalTable extends pulumi.CustomResource {
/**
* Get an existing GlobalTable 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: string, id: pulumi.Input<pulumi.ID>, state?: GlobalTableState, opts?: pulumi.CustomResourceOptions): GlobalTable;
/**
* Returns true if the given object is an instance of GlobalTable. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is GlobalTable;
/**
* The ARN of the DynamoDB Global Table
*/
readonly arn: pulumi.Output<string>;
/**
* The name of the global table. Must match underlying DynamoDB Table names in all regions.
*/
readonly name: pulumi.Output<string>;
/**
* Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
*/
readonly region: pulumi.Output<string>;
/**
* Underlying DynamoDB Table. At least 1 replica must be defined. See below.
*/
readonly replicas: pulumi.Output<outputs.dynamodb.GlobalTableReplica[]>;
/**
* Create a GlobalTable resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: GlobalTableArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering GlobalTable resources.
*/
export interface GlobalTableState {
/**
* The ARN of the DynamoDB Global Table
*/
arn?: pulumi.Input<string>;
/**
* The name of the global table. Must match underlying DynamoDB Table names in all regions.
*/
name?: pulumi.Input<string>;
/**
* Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
*/
region?: pulumi.Input<string>;
/**
* Underlying DynamoDB Table. At least 1 replica must be defined. See below.
*/
replicas?: pulumi.Input<pulumi.Input<inputs.dynamodb.GlobalTableReplica>[]>;
}
/**
* The set of arguments for constructing a GlobalTable resource.
*/
export interface GlobalTableArgs {
/**
* The name of the global table. Must match underlying DynamoDB Table names in all regions.
*/
name?: pulumi.Input<string>;
/**
* Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
*/
region?: pulumi.Input<string>;
/**
* Underlying DynamoDB Table. At least 1 replica must be defined. See below.
*/
replicas: pulumi.Input<pulumi.Input<inputs.dynamodb.GlobalTableReplica>[]>;
}