Table Replica
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 thereplica
configuration block of aws.dynamodb.Table together with this resource as the two configuration options are mutually exclusive.
Example Usage
Basic Example
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
DynamoDB table replicas can be imported using the table-name:main-region
, e.g.,
$ pulumi import aws:dynamodb/tableReplica:TableReplica example TestTable:us-west-2
Properties
ARN of the main or global table which this resource will replicate. Optional arguments:
Whether to enable Point In Time Recovery for the replica. Default is false
.
Storage class of the table replica. Valid values are STANDARD
and STANDARD_INFREQUENT_ACCESS
. If not used, the table replica will use the same class as the global table.