Try AWS Native preview for resources not in the classic version.
aws.dynamodb.TableReplica
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
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
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var main = new Aws.Provider("main", new()
{
Region = "us-west-2",
});
var alt = new Aws.Provider("alt", new()
{
Region = "us-east-2",
});
var exampleTable = new Aws.DynamoDB.Table("exampleTable", new()
{
HashKey = "BrodoBaggins",
BillingMode = "PAY_PER_REQUEST",
StreamEnabled = true,
StreamViewType = "NEW_AND_OLD_IMAGES",
Attributes = new[]
{
new Aws.DynamoDB.Inputs.TableAttributeArgs
{
Name = "BrodoBaggins",
Type = "S",
},
},
}, new CustomResourceOptions
{
Provider = aws.Main,
});
var exampleTableReplica = new Aws.DynamoDB.TableReplica("exampleTableReplica", new()
{
GlobalTableArn = exampleTable.Arn,
Tags =
{
{ "Name", "IZPAWS" },
{ "Pozo", "Amargo" },
},
}, new CustomResourceOptions
{
Provider = aws.Alt,
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
"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 {
_, err := aws.NewProvider(ctx, "main", &aws.ProviderArgs{
Region: pulumi.String("us-west-2"),
})
if err != nil {
return err
}
_, err = aws.NewProvider(ctx, "alt", &aws.ProviderArgs{
Region: pulumi.String("us-east-2"),
})
if err != nil {
return err
}
exampleTable, err := dynamodb.NewTable(ctx, "exampleTable", &dynamodb.TableArgs{
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"),
},
},
}, pulumi.Provider(aws.Main))
if err != nil {
return err
}
_, err = dynamodb.NewTableReplica(ctx, "exampleTableReplica", &dynamodb.TableReplicaArgs{
GlobalTableArn: exampleTable.Arn,
Tags: pulumi.StringMap{
"Name": pulumi.String("IZPAWS"),
"Pozo": pulumi.String("Amargo"),
},
}, pulumi.Provider(aws.Alt))
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.Provider;
import com.pulumi.aws.ProviderArgs;
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 com.pulumi.resources.CustomResourceOptions;
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 main = new Provider("main", ProviderArgs.builder()
.region("us-west-2")
.build());
var alt = new Provider("alt", ProviderArgs.builder()
.region("us-east-2")
.build());
var exampleTable = new Table("exampleTable", TableArgs.builder()
.hashKey("BrodoBaggins")
.billingMode("PAY_PER_REQUEST")
.streamEnabled(true)
.streamViewType("NEW_AND_OLD_IMAGES")
.attributes(TableAttributeArgs.builder()
.name("BrodoBaggins")
.type("S")
.build())
.build(), CustomResourceOptions.builder()
.provider(aws.main())
.build());
var exampleTableReplica = new TableReplica("exampleTableReplica", TableReplicaArgs.builder()
.globalTableArn(exampleTable.arn())
.tags(Map.ofEntries(
Map.entry("Name", "IZPAWS"),
Map.entry("Pozo", "Amargo")
))
.build(), CustomResourceOptions.builder()
.provider(aws.alt())
.build());
}
}
import pulumi
import pulumi_aws as aws
main = aws.Provider("main", region="us-west-2")
alt = aws.Provider("alt", region="us-east-2")
example_table = aws.dynamodb.Table("exampleTable",
hash_key="BrodoBaggins",
billing_mode="PAY_PER_REQUEST",
stream_enabled=True,
stream_view_type="NEW_AND_OLD_IMAGES",
attributes=[aws.dynamodb.TableAttributeArgs(
name="BrodoBaggins",
type="S",
)],
opts=pulumi.ResourceOptions(provider=aws["main"]))
example_table_replica = aws.dynamodb.TableReplica("exampleTableReplica",
global_table_arn=example_table.arn,
tags={
"Name": "IZPAWS",
"Pozo": "Amargo",
},
opts=pulumi.ResourceOptions(provider=aws["alt"]))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const main = new aws.Provider("main", {region: "us-west-2"});
const alt = new aws.Provider("alt", {region: "us-east-2"});
const exampleTable = new aws.dynamodb.Table("exampleTable", {
hashKey: "BrodoBaggins",
billingMode: "PAY_PER_REQUEST",
streamEnabled: true,
streamViewType: "NEW_AND_OLD_IMAGES",
attributes: [{
name: "BrodoBaggins",
type: "S",
}],
}, {
provider: aws.main,
});
const exampleTableReplica = new aws.dynamodb.TableReplica("exampleTableReplica", {
globalTableArn: exampleTable.arn,
tags: {
Name: "IZPAWS",
Pozo: "Amargo",
},
}, {
provider: aws.alt,
});
resources:
main:
type: pulumi:providers:aws
properties:
region: us-west-2
alt:
type: pulumi:providers:aws
properties:
region: us-east-2
exampleTable:
type: aws:dynamodb:Table
properties:
hashKey: BrodoBaggins
billingMode: PAY_PER_REQUEST
streamEnabled: true
streamViewType: NEW_AND_OLD_IMAGES
attributes:
- name: BrodoBaggins
type: S
options:
provider: ${aws.main}
exampleTableReplica:
type: aws:dynamodb:TableReplica
properties:
globalTableArn: ${exampleTable.arn}
tags:
Name: IZPAWS
Pozo: Amargo
options:
provider: ${aws.alt}
Create TableReplica Resource
new TableReplica(name: string, args: TableReplicaArgs, opts?: CustomResourceOptions);
@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)
@overload
def TableReplica(resource_name: str,
args: TableReplicaInitArgs,
opts: Optional[ResourceOptions] = 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.
- 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.
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.Please use
tags
instead.
- 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.Please use
tags
instead.
- 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.Please use
tags
instead.
- 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.Please use
tags
instead.
- 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.Please use
tags
instead.
- 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.Please use
tags
instead.
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
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
aws
Terraform Provider.
Try AWS Native preview for resources not in the classic version.