TableReplicaDynamodb class

Provides a DynamoDB table replica resource for DynamoDB Global Tables V2 (version 2019.11.21).

> Note: Use lifecycle ignoreChanges 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

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.dynamodb.Table("example", {
    attributes: [{
        name: "BrodoBaggins",
        type: "S",
    }],
    name: "TestTable",
    hashKey: "BrodoBaggins",
    billingMode: "PAY_PER_REQUEST",
    streamEnabled: true,
    streamViewType: "NEW_AND_OLD_IMAGES",
}, {
    ignoreChanges: ["replicas"],
});
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",
    attributes=[{
        "name": "BrodoBaggins",
        "type": "S",
    }],
    name="TestTable",
    hash_key="BrodoBaggins",
    billing_mode="PAY_PER_REQUEST",
    stream_enabled=True,
    stream_view_type="NEW_AND_OLD_IMAGES",
    opts = pulumi.ResourceOptions(ignore_changes=["replicas"]))
example_table_replica = aws.dynamodb.TableReplica("example",
    global_table_arn=example.arn,
    tags={
        "Name": "IZPAWS",
        "Pozo": "Amargo",
    })
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()
    {
        Attributes = new[]
        {
            new Aws.DynamoDB.Inputs.TableAttributeArgs
            {
                Name = "BrodoBaggins",
                Type = "S",
            },
        },
        Name = "TestTable",
        HashKey = "BrodoBaggins",
        BillingMode = "PAY_PER_REQUEST",
        StreamEnabled = true,
        StreamViewType = "NEW_AND_OLD_IMAGES",
    }, new CustomResourceOptions
    {
        IgnoreChanges =
        {
            "replicas",
        },
    });

    var exampleTableReplica = new Aws.DynamoDB.TableReplica("example", new()
    {
        GlobalTableArn = example.Arn,
        Tags =
        {
            { "Name", "IZPAWS" },
            { "Pozo", "Amargo" },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/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{
			Attributes: dynamodb.TableAttributeArray{
				&dynamodb.TableAttributeArgs{
					Name: pulumi.String("BrodoBaggins"),
					Type: pulumi.String("S"),
				},
			},
			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"),
		}, pulumi.IgnoreChanges([]string{
			"replicas",
		}))
		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
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_dynamodb_table" "example" {
  lifecycle {
    ignore_changes = [replicas]
  }
  attributes {
    name = "BrodoBaggins"
    type = "S"
  }
  name             = "TestTable"
  hash_key         = "BrodoBaggins"
  billing_mode     = "PAY_PER_REQUEST"
  stream_enabled   = true
  stream_view_type = "NEW_AND_OLD_IMAGES"
}
resource "aws_dynamodb_tablereplica" "example" {
  global_table_arn = aws_dynamodb_table.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 com.pulumi.resources.CustomResourceOptions;
import java.util.ArrayList;
import java.util.Arrays;
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()
            .attributes(TableAttributeArgs.builder()
                .name("BrodoBaggins")
                .type("S")
                .build())
            .name("TestTable")
            .hashKey("BrodoBaggins")
            .billingMode("PAY_PER_REQUEST")
            .streamEnabled(true)
            .streamViewType("NEW_AND_OLD_IMAGES")
            .build(), CustomResourceOptions.builder()
                .ignoreChanges("replicas")
                .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:
      attributes:
        - name: BrodoBaggins
          type: S
      name: TestTable
      hashKey: BrodoBaggins
      billingMode: PAY_PER_REQUEST
      streamEnabled: true
      streamViewType: NEW_AND_OLD_IMAGES
    options:
      ignoreChanges:
        - replicas
  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.

$ pulumi import aws:dynamodb/tableReplica:TableReplica example TestTable:us-west-2

Constructors

TableReplicaDynamodb(String name, {TableReplicaArgs? args, CustomResourceOptions? options})
Creates a new TableReplicaDynamodb. name The Pulumi resource name. args Arguments used to configure this TableReplicaDynamodb. The set of arguments for TableReplica. options Resource options controlling this resource's behavior.
TableReplicaDynamodb.reference(String urn)
Creates a typed reference to an existing TableReplicaDynamodb resource.

Properties

arn ↔ Output<String>
ARN of the table replica.
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
deletionProtectionEnabled ↔ Output<bool>
Whether deletion protection is enabled (true) or disabled (false) on the table replica.
latefinal
globalTableArn ↔ Output<String>
ARN of the main or global table which this resource will replicate.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
kmsKeyArn ↔ Output<String>
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.
latefinal
pointInTimeRecovery ↔ Output<bool?>
Whether to enable Point In Time Recovery for the table replica. Default is false.
latefinal
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tableClassOverride ↔ Output<String?>
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.
latefinal
tags ↔ Output<Map<String, String>?>
Map of tags to populate on the created table. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
latefinal
tagsAll ↔ Output<Map<String, String>>
Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {TableReplicaState? state, CustomResourceOptions? options}) → TableReplicaDynamodb
Gets an existing TableReplicaDynamodb resource's state with the given name and id.