aws.dynamodb.TableReplica
Explore with Pulumi AI
Provides a DynamoDB table replica resource for DynamoDB Global Tables V2 (version 2019.11.21).
Note: Use
lifecycle
ignore_changes
forreplica
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
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 pulumi
import pulumi_aws as aws
example = aws.dynamodb.Table("example",
name="TestTable",
hash_key="BrodoBaggins",
billing_mode="PAY_PER_REQUEST",
stream_enabled=True,
stream_view_type="NEW_AND_OLD_IMAGES",
attributes=[{
"name": "BrodoBaggins",
"type": "S",
}])
example_table_replica = aws.dynamodb.TableReplica("example",
global_table_arn=example.arn,
tags={
"Name": "IZPAWS",
"Pozo": "Amargo",
})
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/dynamodb"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := dynamodb.NewTable(ctx, "example", &dynamodb.TableArgs{
Name: pulumi.String("TestTable"),
HashKey: pulumi.String("BrodoBaggins"),
BillingMode: pulumi.String("PAY_PER_REQUEST"),
StreamEnabled: pulumi.Bool(true),
StreamViewType: pulumi.String("NEW_AND_OLD_IMAGES"),
Attributes: dynamodb.TableAttributeArray{
&dynamodb.TableAttributeArgs{
Name: pulumi.String("BrodoBaggins"),
Type: pulumi.String("S"),
},
},
})
if err != nil {
return err
}
_, err = dynamodb.NewTableReplica(ctx, "example", &dynamodb.TableReplicaArgs{
GlobalTableArn: example.Arn,
Tags: pulumi.StringMap{
"Name": pulumi.String("IZPAWS"),
"Pozo": pulumi.String("Amargo"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.DynamoDB.Table("example", new()
{
Name = "TestTable",
HashKey = "BrodoBaggins",
BillingMode = "PAY_PER_REQUEST",
StreamEnabled = true,
StreamViewType = "NEW_AND_OLD_IMAGES",
Attributes = new[]
{
new Aws.DynamoDB.Inputs.TableAttributeArgs
{
Name = "BrodoBaggins",
Type = "S",
},
},
});
var exampleTableReplica = new Aws.DynamoDB.TableReplica("example", new()
{
GlobalTableArn = example.Arn,
Tags =
{
{ "Name", "IZPAWS" },
{ "Pozo", "Amargo" },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.dynamodb.Table;
import com.pulumi.aws.dynamodb.TableArgs;
import com.pulumi.aws.dynamodb.inputs.TableAttributeArgs;
import com.pulumi.aws.dynamodb.TableReplica;
import com.pulumi.aws.dynamodb.TableReplicaArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Table("example", TableArgs.builder()
.name("TestTable")
.hashKey("BrodoBaggins")
.billingMode("PAY_PER_REQUEST")
.streamEnabled(true)
.streamViewType("NEW_AND_OLD_IMAGES")
.attributes(TableAttributeArgs.builder()
.name("BrodoBaggins")
.type("S")
.build())
.build());
var exampleTableReplica = new TableReplica("exampleTableReplica", TableReplicaArgs.builder()
.globalTableArn(example.arn())
.tags(Map.ofEntries(
Map.entry("Name", "IZPAWS"),
Map.entry("Pozo", "Amargo")
))
.build());
}
}
resources:
example:
type: aws:dynamodb:Table
properties:
name: TestTable
hashKey: BrodoBaggins
billingMode: PAY_PER_REQUEST
streamEnabled: true
streamViewType: NEW_AND_OLD_IMAGES
attributes:
- name: BrodoBaggins
type: S
exampleTableReplica:
type: aws:dynamodb:TableReplica
name: example
properties:
globalTableArn: ${example.arn}
tags:
Name: IZPAWS
Pozo: Amargo
Create TableReplica Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new TableReplica(name: string, args: TableReplicaArgs, opts?: CustomResourceOptions);
@overload
def TableReplica(resource_name: str,
args: TableReplicaInitArgs,
opts: Optional[ResourceOptions] = None)
@overload
def TableReplica(resource_name: str,
opts: Optional[ResourceOptions] = None,
global_table_arn: Optional[str] = None,
kms_key_arn: Optional[str] = None,
point_in_time_recovery: Optional[bool] = None,
table_class_override: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)
func NewTableReplica(ctx *Context, name string, args TableReplicaArgs, opts ...ResourceOption) (*TableReplica, error)
public TableReplica(string name, TableReplicaArgs args, CustomResourceOptions? opts = null)
public TableReplica(String name, TableReplicaArgs args)
public TableReplica(String name, TableReplicaArgs args, CustomResourceOptions options)
type: aws:dynamodb:TableReplica
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args TableReplicaArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args TableReplicaInitArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args TableReplicaArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TableReplicaArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args TableReplicaArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var tableReplicaResource = new Aws.DynamoDB.TableReplica("tableReplicaResource", new()
{
GlobalTableArn = "string",
KmsKeyArn = "string",
PointInTimeRecovery = false,
TableClassOverride = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := dynamodb.NewTableReplica(ctx, "tableReplicaResource", &dynamodb.TableReplicaArgs{
GlobalTableArn: pulumi.String("string"),
KmsKeyArn: pulumi.String("string"),
PointInTimeRecovery: pulumi.Bool(false),
TableClassOverride: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var tableReplicaResource = new TableReplica("tableReplicaResource", TableReplicaArgs.builder()
.globalTableArn("string")
.kmsKeyArn("string")
.pointInTimeRecovery(false)
.tableClassOverride("string")
.tags(Map.of("string", "string"))
.build());
table_replica_resource = aws.dynamodb.TableReplica("tableReplicaResource",
global_table_arn="string",
kms_key_arn="string",
point_in_time_recovery=False,
table_class_override="string",
tags={
"string": "string",
})
const tableReplicaResource = new aws.dynamodb.TableReplica("tableReplicaResource", {
globalTableArn: "string",
kmsKeyArn: "string",
pointInTimeRecovery: false,
tableClassOverride: "string",
tags: {
string: "string",
},
});
type: aws:dynamodb:TableReplica
properties:
globalTableArn: string
kmsKeyArn: string
pointInTimeRecovery: false
tableClassOverride: string
tags:
string: string
TableReplica Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The TableReplica resource accepts the following input properties:
- Global
Table stringArn ARN of the main or global table which this resource will replicate.
Optional arguments:
- Kms
Key stringArn - ARN of the CMK that should be used for the AWS KMS encryption. This argument should only be used if the key is different from the default KMS-managed DynamoDB key,
alias/aws/dynamodb
. Note: This attribute will not be populated with the ARN of default keys. - Point
In boolTime Recovery - Whether to enable Point In Time Recovery for the replica. Default is
false
. - Table
Class stringOverride - Storage class of the table replica. Valid values are
STANDARD
andSTANDARD_INFREQUENT_ACCESS
. If not used, the table replica will use the same class as the global table. - Dictionary<string, string>
- Map of tags to populate on the created table. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- Global
Table stringArn ARN of the main or global table which this resource will replicate.
Optional arguments:
- Kms
Key stringArn - ARN of the CMK that should be used for the AWS KMS encryption. This argument should only be used if the key is different from the default KMS-managed DynamoDB key,
alias/aws/dynamodb
. Note: This attribute will not be populated with the ARN of default keys. - Point
In boolTime Recovery - Whether to enable Point In Time Recovery for the replica. Default is
false
. - Table
Class stringOverride - Storage class of the table replica. Valid values are
STANDARD
andSTANDARD_INFREQUENT_ACCESS
. If not used, the table replica will use the same class as the global table. - map[string]string
- Map of tags to populate on the created table. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- global
Table StringArn ARN of the main or global table which this resource will replicate.
Optional arguments:
- kms
Key StringArn - ARN of the CMK that should be used for the AWS KMS encryption. This argument should only be used if the key is different from the default KMS-managed DynamoDB key,
alias/aws/dynamodb
. Note: This attribute will not be populated with the ARN of default keys. - point
In BooleanTime Recovery - Whether to enable Point In Time Recovery for the replica. Default is
false
. - table
Class StringOverride - Storage class of the table replica. Valid values are
STANDARD
andSTANDARD_INFREQUENT_ACCESS
. If not used, the table replica will use the same class as the global table. - Map<String,String>
- Map of tags to populate on the created table. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- global
Table stringArn ARN of the main or global table which this resource will replicate.
Optional arguments:
- kms
Key stringArn - ARN of the CMK that should be used for the AWS KMS encryption. This argument should only be used if the key is different from the default KMS-managed DynamoDB key,
alias/aws/dynamodb
. Note: This attribute will not be populated with the ARN of default keys. - point
In booleanTime Recovery - Whether to enable Point In Time Recovery for the replica. Default is
false
. - table
Class stringOverride - Storage class of the table replica. Valid values are
STANDARD
andSTANDARD_INFREQUENT_ACCESS
. If not used, the table replica will use the same class as the global table. - {[key: string]: string}
- Map of tags to populate on the created table. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- global_
table_ strarn ARN of the main or global table which this resource will replicate.
Optional arguments:
- kms_
key_ strarn - ARN of the CMK that should be used for the AWS KMS encryption. This argument should only be used if the key is different from the default KMS-managed DynamoDB key,
alias/aws/dynamodb
. Note: This attribute will not be populated with the ARN of default keys. - point_
in_ booltime_ recovery - Whether to enable Point In Time Recovery for the replica. Default is
false
. - table_
class_ stroverride - Storage class of the table replica. Valid values are
STANDARD
andSTANDARD_INFREQUENT_ACCESS
. If not used, the table replica will use the same class as the global table. - Mapping[str, str]
- Map of tags to populate on the created table. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- global
Table StringArn ARN of the main or global table which this resource will replicate.
Optional arguments:
- kms
Key StringArn - ARN of the CMK that should be used for the AWS KMS encryption. This argument should only be used if the key is different from the default KMS-managed DynamoDB key,
alias/aws/dynamodb
. Note: This attribute will not be populated with the ARN of default keys. - point
In BooleanTime Recovery - Whether to enable Point In Time Recovery for the replica. Default is
false
. - table
Class StringOverride - Storage class of the table replica. Valid values are
STANDARD
andSTANDARD_INFREQUENT_ACCESS
. If not used, the table replica will use the same class as the global table. - Map<String>
- Map of tags to populate on the created table. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Outputs
All input properties are implicitly available as output properties. Additionally, the TableReplica resource produces the following output properties:
Look up Existing TableReplica Resource
Get an existing TableReplica resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: TableReplicaState, opts?: CustomResourceOptions): TableReplica
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
arn: Optional[str] = None,
global_table_arn: Optional[str] = None,
kms_key_arn: Optional[str] = None,
point_in_time_recovery: Optional[bool] = None,
table_class_override: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None) -> TableReplica
func GetTableReplica(ctx *Context, name string, id IDInput, state *TableReplicaState, opts ...ResourceOption) (*TableReplica, error)
public static TableReplica Get(string name, Input<string> id, TableReplicaState? state, CustomResourceOptions? opts = null)
public static TableReplica get(String name, Output<String> id, TableReplicaState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Arn string
- ARN of the table replica.
- Global
Table stringArn ARN of the main or global table which this resource will replicate.
Optional arguments:
- Kms
Key stringArn - ARN of the CMK that should be used for the AWS KMS encryption. This argument should only be used if the key is different from the default KMS-managed DynamoDB key,
alias/aws/dynamodb
. Note: This attribute will not be populated with the ARN of default keys. - Point
In boolTime Recovery - Whether to enable Point In Time Recovery for the replica. Default is
false
. - Table
Class stringOverride - Storage class of the table replica. Valid values are
STANDARD
andSTANDARD_INFREQUENT_ACCESS
. If not used, the table replica will use the same class as the global table. - Dictionary<string, string>
- Map of tags to populate on the created table. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Dictionary<string, string>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- Arn string
- ARN of the table replica.
- Global
Table stringArn ARN of the main or global table which this resource will replicate.
Optional arguments:
- Kms
Key stringArn - ARN of the CMK that should be used for the AWS KMS encryption. This argument should only be used if the key is different from the default KMS-managed DynamoDB key,
alias/aws/dynamodb
. Note: This attribute will not be populated with the ARN of default keys. - Point
In boolTime Recovery - Whether to enable Point In Time Recovery for the replica. Default is
false
. - Table
Class stringOverride - Storage class of the table replica. Valid values are
STANDARD
andSTANDARD_INFREQUENT_ACCESS
. If not used, the table replica will use the same class as the global table. - map[string]string
- Map of tags to populate on the created table. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - map[string]string
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- ARN of the table replica.
- global
Table StringArn ARN of the main or global table which this resource will replicate.
Optional arguments:
- kms
Key StringArn - ARN of the CMK that should be used for the AWS KMS encryption. This argument should only be used if the key is different from the default KMS-managed DynamoDB key,
alias/aws/dynamodb
. Note: This attribute will not be populated with the ARN of default keys. - point
In BooleanTime Recovery - Whether to enable Point In Time Recovery for the replica. Default is
false
. - table
Class StringOverride - Storage class of the table replica. Valid values are
STANDARD
andSTANDARD_INFREQUENT_ACCESS
. If not used, the table replica will use the same class as the global table. - Map<String,String>
- Map of tags to populate on the created table. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String,String>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn string
- ARN of the table replica.
- global
Table stringArn ARN of the main or global table which this resource will replicate.
Optional arguments:
- kms
Key stringArn - ARN of the CMK that should be used for the AWS KMS encryption. This argument should only be used if the key is different from the default KMS-managed DynamoDB key,
alias/aws/dynamodb
. Note: This attribute will not be populated with the ARN of default keys. - point
In booleanTime Recovery - Whether to enable Point In Time Recovery for the replica. Default is
false
. - table
Class stringOverride - Storage class of the table replica. Valid values are
STANDARD
andSTANDARD_INFREQUENT_ACCESS
. If not used, the table replica will use the same class as the global table. - {[key: string]: string}
- Map of tags to populate on the created table. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - {[key: string]: string}
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn str
- ARN of the table replica.
- global_
table_ strarn ARN of the main or global table which this resource will replicate.
Optional arguments:
- kms_
key_ strarn - ARN of the CMK that should be used for the AWS KMS encryption. This argument should only be used if the key is different from the default KMS-managed DynamoDB key,
alias/aws/dynamodb
. Note: This attribute will not be populated with the ARN of default keys. - point_
in_ booltime_ recovery - Whether to enable Point In Time Recovery for the replica. Default is
false
. - table_
class_ stroverride - Storage class of the table replica. Valid values are
STANDARD
andSTANDARD_INFREQUENT_ACCESS
. If not used, the table replica will use the same class as the global table. - Mapping[str, str]
- Map of tags to populate on the created table. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Mapping[str, str]
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- ARN of the table replica.
- global
Table StringArn ARN of the main or global table which this resource will replicate.
Optional arguments:
- kms
Key StringArn - ARN of the CMK that should be used for the AWS KMS encryption. This argument should only be used if the key is different from the default KMS-managed DynamoDB key,
alias/aws/dynamodb
. Note: This attribute will not be populated with the ARN of default keys. - point
In BooleanTime Recovery - Whether to enable Point In Time Recovery for the replica. Default is
false
. - table
Class StringOverride - Storage class of the table replica. Valid values are
STANDARD
andSTANDARD_INFREQUENT_ACCESS
. If not used, the table replica will use the same class as the global table. - Map<String>
- Map of tags to populate on the created table. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
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.
$ pulumi import aws:dynamodb/tableReplica:TableReplica example TestTable:us-west-2
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.