
com.pulumi.aws.dynamodb.kotlin.TableReplicaArgs.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.aws.dynamodb.kotlin
import com.pulumi.aws.dynamodb.TableReplicaArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* 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` `ignore_changes` 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",
* },
* });
* ```
* ```python
* 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",
* })
* ```
* ```csharp
* 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" },
* },
* });
* });
* ```
* ```go
* 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
* })
* }
* ```
* ```java
* 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());
* }
* }
* ```
* ```yaml
* 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
* ```
*
* ## 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
* ```
* @property deletionProtectionEnabled Whether deletion protection is enabled (true) or disabled (false) on the table replica.
* @property globalTableArn ARN of the _main_ or global table which this resource will replicate.
* Optional arguments:
* @property kmsKeyArn 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.
* @property pointInTimeRecovery Whether to enable Point In Time Recovery for the table replica. Default is `false`.
* @property tableClassOverride 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.
* @property tags 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.
*/
public data class TableReplicaArgs(
public val deletionProtectionEnabled: Output? = null,
public val globalTableArn: Output? = null,
public val kmsKeyArn: Output? = null,
public val pointInTimeRecovery: Output? = null,
public val tableClassOverride: Output? = null,
public val tags: Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy