Table

Provides a DynamoDB table resource

Note: It is recommended to use ignoreChanges for read_capacity and/or write_capacity if there’s autoscaling policy attached to the table.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var basic_dynamodb_table = new Aws.DynamoDB.Table("basic-dynamodb-table", new Aws.DynamoDB.TableArgs
        {
            Attributes = 
            {
                new Aws.DynamoDB.Inputs.TableAttributeArgs
                {
                    Name = "UserId",
                    Type = "S",
                },
                new Aws.DynamoDB.Inputs.TableAttributeArgs
                {
                    Name = "GameTitle",
                    Type = "S",
                },
                new Aws.DynamoDB.Inputs.TableAttributeArgs
                {
                    Name = "TopScore",
                    Type = "N",
                },
            },
            BillingMode = "PROVISIONED",
            GlobalSecondaryIndexes = 
            {
                new Aws.DynamoDB.Inputs.TableGlobalSecondaryIndexArgs
                {
                    HashKey = "GameTitle",
                    Name = "GameTitleIndex",
                    NonKeyAttributes = 
                    {
                        "UserId",
                    },
                    ProjectionType = "INCLUDE",
                    RangeKey = "TopScore",
                    ReadCapacity = 10,
                    WriteCapacity = 10,
                },
            },
            HashKey = "UserId",
            RangeKey = "GameTitle",
            ReadCapacity = 20,
            Tags = 
            {
                { "Environment", "production" },
                { "Name", "dynamodb-table-1" },
            },
            Ttl = new Aws.DynamoDB.Inputs.TableTtlArgs
            {
                AttributeName = "TimeToExist",
                Enabled = false,
            },
            WriteCapacity = 20,
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/dynamodb"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := dynamodb.NewTable(ctx, "basic_dynamodb_table", &dynamodb.TableArgs{
			Attributes: dynamodb.TableAttributeArray{
				&dynamodb.TableAttributeArgs{
					Name: pulumi.String("UserId"),
					Type: pulumi.String("S"),
				},
				&dynamodb.TableAttributeArgs{
					Name: pulumi.String("GameTitle"),
					Type: pulumi.String("S"),
				},
				&dynamodb.TableAttributeArgs{
					Name: pulumi.String("TopScore"),
					Type: pulumi.String("N"),
				},
			},
			BillingMode: pulumi.String("PROVISIONED"),
			GlobalSecondaryIndexes: dynamodb.TableGlobalSecondaryIndexArray{
				&dynamodb.TableGlobalSecondaryIndexArgs{
					HashKey: pulumi.String("GameTitle"),
					Name:    pulumi.String("GameTitleIndex"),
					NonKeyAttributes: pulumi.StringArray{
						pulumi.String("UserId"),
					},
					ProjectionType: pulumi.String("INCLUDE"),
					RangeKey:       pulumi.String("TopScore"),
					ReadCapacity:   pulumi.Int(10),
					WriteCapacity:  pulumi.Int(10),
				},
			},
			HashKey:      pulumi.String("UserId"),
			RangeKey:     pulumi.String("GameTitle"),
			ReadCapacity: pulumi.Int(20),
			Tags: pulumi.StringMap{
				"Environment": pulumi.String("production"),
				"Name":        pulumi.String("dynamodb-table-1"),
			},
			Ttl: &dynamodb.TableTtlArgs{
				AttributeName: pulumi.String("TimeToExist"),
				Enabled:       pulumi.Bool(false),
			},
			WriteCapacity: pulumi.Int(20),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

basic_dynamodb_table = aws.dynamodb.Table("basic-dynamodb-table",
    attributes=[
        aws.dynamodb.TableAttributeArgs(
            name="UserId",
            type="S",
        ),
        aws.dynamodb.TableAttributeArgs(
            name="GameTitle",
            type="S",
        ),
        aws.dynamodb.TableAttributeArgs(
            name="TopScore",
            type="N",
        ),
    ],
    billing_mode="PROVISIONED",
    global_secondary_indexes=[aws.dynamodb.TableGlobalSecondaryIndexArgs(
        hash_key="GameTitle",
        name="GameTitleIndex",
        non_key_attributes=["UserId"],
        projection_type="INCLUDE",
        range_key="TopScore",
        read_capacity=10,
        write_capacity=10,
    )],
    hash_key="UserId",
    range_key="GameTitle",
    read_capacity=20,
    tags={
        "Environment": "production",
        "Name": "dynamodb-table-1",
    },
    ttl=aws.dynamodb.TableTtlArgs(
        attribute_name="TimeToExist",
        enabled=False,
    ),
    write_capacity=20)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const basic_dynamodb_table = new aws.dynamodb.Table("basic-dynamodb-table", {
    attributes: [
        {
            name: "UserId",
            type: "S",
        },
        {
            name: "GameTitle",
            type: "S",
        },
        {
            name: "TopScore",
            type: "N",
        },
    ],
    billingMode: "PROVISIONED",
    globalSecondaryIndexes: [{
        hashKey: "GameTitle",
        name: "GameTitleIndex",
        nonKeyAttributes: ["UserId"],
        projectionType: "INCLUDE",
        rangeKey: "TopScore",
        readCapacity: 10,
        writeCapacity: 10,
    }],
    hashKey: "UserId",
    rangeKey: "GameTitle",
    readCapacity: 20,
    tags: {
        Environment: "production",
        Name: "dynamodb-table-1",
    },
    ttl: {
        attributeName: "TimeToExist",
        enabled: false,
    },
    writeCapacity: 20,
});

Global Tables

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Aws.DynamoDB.Table("example", new Aws.DynamoDB.TableArgs
        {
            Attributes = 
            {
                new Aws.DynamoDB.Inputs.TableAttributeArgs
                {
                    Name = "TestTableHashKey",
                    Type = "S",
                },
            },
            BillingMode = "PAY_PER_REQUEST",
            HashKey = "TestTableHashKey",
            Replicas = 
            {
                new Aws.DynamoDB.Inputs.TableReplicaArgs
                {
                    RegionName = "us-east-2",
                },
                new Aws.DynamoDB.Inputs.TableReplicaArgs
                {
                    RegionName = "us-west-2",
                },
            },
            StreamEnabled = true,
            StreamViewType = "NEW_AND_OLD_IMAGES",
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/dynamodb"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := dynamodb.NewTable(ctx, "example", &dynamodb.TableArgs{
			Attributes: dynamodb.TableAttributeArray{
				&dynamodb.TableAttributeArgs{
					Name: pulumi.String("TestTableHashKey"),
					Type: pulumi.String("S"),
				},
			},
			BillingMode: pulumi.String("PAY_PER_REQUEST"),
			HashKey:     pulumi.String("TestTableHashKey"),
			Replicas: dynamodb.TableReplicaArray{
				&dynamodb.TableReplicaArgs{
					RegionName: pulumi.String("us-east-2"),
				},
				&dynamodb.TableReplicaArgs{
					RegionName: pulumi.String("us-west-2"),
				},
			},
			StreamEnabled:  pulumi.Bool(true),
			StreamViewType: pulumi.String("NEW_AND_OLD_IMAGES"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

example = aws.dynamodb.Table("example",
    attributes=[aws.dynamodb.TableAttributeArgs(
        name="TestTableHashKey",
        type="S",
    )],
    billing_mode="PAY_PER_REQUEST",
    hash_key="TestTableHashKey",
    replicas=[
        aws.dynamodb.TableReplicaArgs(
            region_name="us-east-2",
        ),
        aws.dynamodb.TableReplicaArgs(
            region_name="us-west-2",
        ),
    ],
    stream_enabled=True,
    stream_view_type="NEW_AND_OLD_IMAGES")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.dynamodb.Table("example", {
    attributes: [{
        name: "TestTableHashKey",
        type: "S",
    }],
    billingMode: "PAY_PER_REQUEST",
    hashKey: "TestTableHashKey",
    replicas: [
        {
            regionName: "us-east-2",
        },
        {
            regionName: "us-west-2",
        },
    ],
    streamEnabled: true,
    streamViewType: "NEW_AND_OLD_IMAGES",
});

Create a Table Resource

new Table(name: string, args: TableArgs, opts?: CustomResourceOptions);
@overload
def Table(resource_name: str,
          opts: Optional[ResourceOptions] = None,
          attributes: Optional[Sequence[TableAttributeArgs]] = None,
          billing_mode: Optional[str] = None,
          global_secondary_indexes: Optional[Sequence[TableGlobalSecondaryIndexArgs]] = None,
          hash_key: Optional[str] = None,
          local_secondary_indexes: Optional[Sequence[TableLocalSecondaryIndexArgs]] = None,
          name: Optional[str] = None,
          point_in_time_recovery: Optional[TablePointInTimeRecoveryArgs] = None,
          range_key: Optional[str] = None,
          read_capacity: Optional[int] = None,
          replicas: Optional[Sequence[TableReplicaArgs]] = None,
          server_side_encryption: Optional[TableServerSideEncryptionArgs] = None,
          stream_enabled: Optional[bool] = None,
          stream_view_type: Optional[str] = None,
          tags: Optional[Mapping[str, str]] = None,
          ttl: Optional[TableTtlArgs] = None,
          write_capacity: Optional[int] = None)
@overload
def Table(resource_name: str,
          args: TableArgs,
          opts: Optional[ResourceOptions] = None)
func NewTable(ctx *Context, name string, args TableArgs, opts ...ResourceOption) (*Table, error)
public Table(string name, TableArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args TableArgs
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 TableArgs
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 TableArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args TableArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Table 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 Table resource accepts the following input properties:

Attributes List<TableAttributeArgs>
List of nested attribute definitions. Only required for hash_key and range_key attributes. Each attribute has two properties:
HashKey string
The name of the hash key in the index; must be defined as an attribute in the resource.
BillingMode string
Controls how you are charged for read and write throughput and how you manage capacity. The valid values are PROVISIONED and PAY_PER_REQUEST. Defaults to PROVISIONED.
GlobalSecondaryIndexes List<TableGlobalSecondaryIndexArgs>
Describe a GSI for the table; subject to the normal limits on the number of GSIs, projected attributes, etc.
LocalSecondaryIndexes List<TableLocalSecondaryIndexArgs>
Describe an LSI on the table; these can only be allocated at creation so you cannot change this definition after you have created the resource.
Name string
The name of the index
PointInTimeRecovery TablePointInTimeRecoveryArgs
Point-in-time recovery options.
RangeKey string
The name of the range key; must be defined
ReadCapacity int
The number of read units for this index. Must be set if billing_mode is set to PROVISIONED.
Replicas List<TableReplicaArgs>
Configuration block(s) with DynamoDB Global Tables V2 (version 2019.11.21) replication configurations. Detailed below.
ServerSideEncryption TableServerSideEncryptionArgs
Encryption at rest options. AWS DynamoDB tables are automatically encrypted at rest with an AWS owned Customer Master Key if this argument isn’t specified.
StreamEnabled bool
Indicates whether Streams are to be enabled (true) or disabled (false).
StreamViewType string
When an item in the table is modified, StreamViewType determines what information is written to the table’s stream. Valid values are KEYS_ONLY, NEW_IMAGE, OLD_IMAGE, NEW_AND_OLD_IMAGES.
Tags Dictionary<string, string>
A 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.
Ttl TableTtlArgs
Defines ttl, has two properties, and can only be specified once:
WriteCapacity int
The number of write units for this index. Must be set if billing_mode is set to PROVISIONED.
Attributes []TableAttributeArgs
List of nested attribute definitions. Only required for hash_key and range_key attributes. Each attribute has two properties:
HashKey string
The name of the hash key in the index; must be defined as an attribute in the resource.
BillingMode string
Controls how you are charged for read and write throughput and how you manage capacity. The valid values are PROVISIONED and PAY_PER_REQUEST. Defaults to PROVISIONED.
GlobalSecondaryIndexes []TableGlobalSecondaryIndexArgs
Describe a GSI for the table; subject to the normal limits on the number of GSIs, projected attributes, etc.
LocalSecondaryIndexes []TableLocalSecondaryIndexArgs
Describe an LSI on the table; these can only be allocated at creation so you cannot change this definition after you have created the resource.
Name string
The name of the index
PointInTimeRecovery TablePointInTimeRecoveryArgs
Point-in-time recovery options.
RangeKey string
The name of the range key; must be defined
ReadCapacity int
The number of read units for this index. Must be set if billing_mode is set to PROVISIONED.
Replicas []TableReplicaArgs
Configuration block(s) with DynamoDB Global Tables V2 (version 2019.11.21) replication configurations. Detailed below.
ServerSideEncryption TableServerSideEncryptionArgs
Encryption at rest options. AWS DynamoDB tables are automatically encrypted at rest with an AWS owned Customer Master Key if this argument isn’t specified.
StreamEnabled bool
Indicates whether Streams are to be enabled (true) or disabled (false).
StreamViewType string
When an item in the table is modified, StreamViewType determines what information is written to the table’s stream. Valid values are KEYS_ONLY, NEW_IMAGE, OLD_IMAGE, NEW_AND_OLD_IMAGES.
Tags map[string]string
A 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.
Ttl TableTtlArgs
Defines ttl, has two properties, and can only be specified once:
WriteCapacity int
The number of write units for this index. Must be set if billing_mode is set to PROVISIONED.
attributes TableAttributeArgs[]
List of nested attribute definitions. Only required for hash_key and range_key attributes. Each attribute has two properties:
hashKey string
The name of the hash key in the index; must be defined as an attribute in the resource.
billingMode string
Controls how you are charged for read and write throughput and how you manage capacity. The valid values are PROVISIONED and PAY_PER_REQUEST. Defaults to PROVISIONED.
globalSecondaryIndexes TableGlobalSecondaryIndexArgs[]
Describe a GSI for the table; subject to the normal limits on the number of GSIs, projected attributes, etc.
localSecondaryIndexes TableLocalSecondaryIndexArgs[]
Describe an LSI on the table; these can only be allocated at creation so you cannot change this definition after you have created the resource.
name string
The name of the index
pointInTimeRecovery TablePointInTimeRecoveryArgs
Point-in-time recovery options.
rangeKey string
The name of the range key; must be defined
readCapacity number
The number of read units for this index. Must be set if billing_mode is set to PROVISIONED.
replicas TableReplicaArgs[]
Configuration block(s) with DynamoDB Global Tables V2 (version 2019.11.21) replication configurations. Detailed below.
serverSideEncryption TableServerSideEncryptionArgs
Encryption at rest options. AWS DynamoDB tables are automatically encrypted at rest with an AWS owned Customer Master Key if this argument isn’t specified.
streamEnabled boolean
Indicates whether Streams are to be enabled (true) or disabled (false).
streamViewType string
When an item in the table is modified, StreamViewType determines what information is written to the table’s stream. Valid values are KEYS_ONLY, NEW_IMAGE, OLD_IMAGE, NEW_AND_OLD_IMAGES.
tags {[key: string]: string}
A 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.
ttl TableTtlArgs
Defines ttl, has two properties, and can only be specified once:
writeCapacity number
The number of write units for this index. Must be set if billing_mode is set to PROVISIONED.
attributes Sequence[TableAttributeArgs]
List of nested attribute definitions. Only required for hash_key and range_key attributes. Each attribute has two properties:
hash_key str
The name of the hash key in the index; must be defined as an attribute in the resource.
billing_mode str
Controls how you are charged for read and write throughput and how you manage capacity. The valid values are PROVISIONED and PAY_PER_REQUEST. Defaults to PROVISIONED.
global_secondary_indexes Sequence[TableGlobalSecondaryIndexArgs]
Describe a GSI for the table; subject to the normal limits on the number of GSIs, projected attributes, etc.
local_secondary_indexes Sequence[TableLocalSecondaryIndexArgs]
Describe an LSI on the table; these can only be allocated at creation so you cannot change this definition after you have created the resource.
name str
The name of the index
point_in_time_recovery TablePointInTimeRecoveryArgs
Point-in-time recovery options.
range_key str
The name of the range key; must be defined
read_capacity int
The number of read units for this index. Must be set if billing_mode is set to PROVISIONED.
replicas Sequence[TableReplicaArgs]
Configuration block(s) with DynamoDB Global Tables V2 (version 2019.11.21) replication configurations. Detailed below.
server_side_encryption TableServerSideEncryptionArgs
Encryption at rest options. AWS DynamoDB tables are automatically encrypted at rest with an AWS owned Customer Master Key if this argument isn’t specified.
stream_enabled bool
Indicates whether Streams are to be enabled (true) or disabled (false).
stream_view_type str
When an item in the table is modified, StreamViewType determines what information is written to the table’s stream. Valid values are KEYS_ONLY, NEW_IMAGE, OLD_IMAGE, NEW_AND_OLD_IMAGES.
tags Mapping[str, str]
A 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.
ttl TableTtlArgs
Defines ttl, has two properties, and can only be specified once:
write_capacity int
The number of write units for this index. Must be set if billing_mode is set to PROVISIONED.

Outputs

All input properties are implicitly available as output properties. Additionally, the Table resource produces the following output properties:

Arn string
The arn of the table
Id string
The provider-assigned unique ID for this managed resource.
StreamArn string
The ARN of the Table Stream. Only available when stream_enabled = true
StreamLabel string
A timestamp, in ISO 8601 format, for this stream. Note that this timestamp is not a unique identifier for the stream on its own. However, the combination of AWS customer ID, table name and this field is guaranteed to be unique. It can be used for creating CloudWatch Alarms. Only available when stream_enabled = true
TagsAll Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider .
Arn string
The arn of the table
Id string
The provider-assigned unique ID for this managed resource.
StreamArn string
The ARN of the Table Stream. Only available when stream_enabled = true
StreamLabel string
A timestamp, in ISO 8601 format, for this stream. Note that this timestamp is not a unique identifier for the stream on its own. However, the combination of AWS customer ID, table name and this field is guaranteed to be unique. It can be used for creating CloudWatch Alarms. Only available when stream_enabled = true
TagsAll map[string]string
A map of tags assigned to the resource, including those inherited from the provider .
arn string
The arn of the table
id string
The provider-assigned unique ID for this managed resource.
streamArn string
The ARN of the Table Stream. Only available when stream_enabled = true
streamLabel string
A timestamp, in ISO 8601 format, for this stream. Note that this timestamp is not a unique identifier for the stream on its own. However, the combination of AWS customer ID, table name and this field is guaranteed to be unique. It can be used for creating CloudWatch Alarms. Only available when stream_enabled = true
tagsAll {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider .
arn str
The arn of the table
id str
The provider-assigned unique ID for this managed resource.
stream_arn str
The ARN of the Table Stream. Only available when stream_enabled = true
stream_label str
A timestamp, in ISO 8601 format, for this stream. Note that this timestamp is not a unique identifier for the stream on its own. However, the combination of AWS customer ID, table name and this field is guaranteed to be unique. It can be used for creating CloudWatch Alarms. Only available when stream_enabled = true
tags_all Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider .

Look up an Existing Table Resource

Get an existing Table 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?: TableState, opts?: CustomResourceOptions): Table
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        attributes: Optional[Sequence[TableAttributeArgs]] = None,
        billing_mode: Optional[str] = None,
        global_secondary_indexes: Optional[Sequence[TableGlobalSecondaryIndexArgs]] = None,
        hash_key: Optional[str] = None,
        local_secondary_indexes: Optional[Sequence[TableLocalSecondaryIndexArgs]] = None,
        name: Optional[str] = None,
        point_in_time_recovery: Optional[TablePointInTimeRecoveryArgs] = None,
        range_key: Optional[str] = None,
        read_capacity: Optional[int] = None,
        replicas: Optional[Sequence[TableReplicaArgs]] = None,
        server_side_encryption: Optional[TableServerSideEncryptionArgs] = None,
        stream_arn: Optional[str] = None,
        stream_enabled: Optional[bool] = None,
        stream_label: Optional[str] = None,
        stream_view_type: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None,
        ttl: Optional[TableTtlArgs] = None,
        write_capacity: Optional[int] = None) -> Table
func GetTable(ctx *Context, name string, id IDInput, state *TableState, opts ...ResourceOption) (*Table, error)
public static Table Get(string name, Input<string> id, TableState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

Arn string
The arn of the table
Attributes List<TableAttributeArgs>
List of nested attribute definitions. Only required for hash_key and range_key attributes. Each attribute has two properties:
BillingMode string
Controls how you are charged for read and write throughput and how you manage capacity. The valid values are PROVISIONED and PAY_PER_REQUEST. Defaults to PROVISIONED.
GlobalSecondaryIndexes List<TableGlobalSecondaryIndexArgs>
Describe a GSI for the table; subject to the normal limits on the number of GSIs, projected attributes, etc.
HashKey string
The name of the hash key in the index; must be defined as an attribute in the resource.
LocalSecondaryIndexes List<TableLocalSecondaryIndexArgs>
Describe an LSI on the table; these can only be allocated at creation so you cannot change this definition after you have created the resource.
Name string
The name of the index
PointInTimeRecovery TablePointInTimeRecoveryArgs
Point-in-time recovery options.
RangeKey string
The name of the range key; must be defined
ReadCapacity int
The number of read units for this index. Must be set if billing_mode is set to PROVISIONED.
Replicas List<TableReplicaArgs>
Configuration block(s) with DynamoDB Global Tables V2 (version 2019.11.21) replication configurations. Detailed below.
ServerSideEncryption TableServerSideEncryptionArgs
Encryption at rest options. AWS DynamoDB tables are automatically encrypted at rest with an AWS owned Customer Master Key if this argument isn’t specified.
StreamArn string
The ARN of the Table Stream. Only available when stream_enabled = true
StreamEnabled bool
Indicates whether Streams are to be enabled (true) or disabled (false).
StreamLabel string
A timestamp, in ISO 8601 format, for this stream. Note that this timestamp is not a unique identifier for the stream on its own. However, the combination of AWS customer ID, table name and this field is guaranteed to be unique. It can be used for creating CloudWatch Alarms. Only available when stream_enabled = true
StreamViewType string
When an item in the table is modified, StreamViewType determines what information is written to the table’s stream. Valid values are KEYS_ONLY, NEW_IMAGE, OLD_IMAGE, NEW_AND_OLD_IMAGES.
Tags Dictionary<string, string>
A 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.
TagsAll Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider .
Ttl TableTtlArgs
Defines ttl, has two properties, and can only be specified once:
WriteCapacity int
The number of write units for this index. Must be set if billing_mode is set to PROVISIONED.
Arn string
The arn of the table
Attributes []TableAttributeArgs
List of nested attribute definitions. Only required for hash_key and range_key attributes. Each attribute has two properties:
BillingMode string
Controls how you are charged for read and write throughput and how you manage capacity. The valid values are PROVISIONED and PAY_PER_REQUEST. Defaults to PROVISIONED.
GlobalSecondaryIndexes []TableGlobalSecondaryIndexArgs
Describe a GSI for the table; subject to the normal limits on the number of GSIs, projected attributes, etc.
HashKey string
The name of the hash key in the index; must be defined as an attribute in the resource.
LocalSecondaryIndexes []TableLocalSecondaryIndexArgs
Describe an LSI on the table; these can only be allocated at creation so you cannot change this definition after you have created the resource.
Name string
The name of the index
PointInTimeRecovery TablePointInTimeRecoveryArgs
Point-in-time recovery options.
RangeKey string
The name of the range key; must be defined
ReadCapacity int
The number of read units for this index. Must be set if billing_mode is set to PROVISIONED.
Replicas []TableReplicaArgs
Configuration block(s) with DynamoDB Global Tables V2 (version 2019.11.21) replication configurations. Detailed below.
ServerSideEncryption TableServerSideEncryptionArgs
Encryption at rest options. AWS DynamoDB tables are automatically encrypted at rest with an AWS owned Customer Master Key if this argument isn’t specified.
StreamArn string
The ARN of the Table Stream. Only available when stream_enabled = true
StreamEnabled bool
Indicates whether Streams are to be enabled (true) or disabled (false).
StreamLabel string
A timestamp, in ISO 8601 format, for this stream. Note that this timestamp is not a unique identifier for the stream on its own. However, the combination of AWS customer ID, table name and this field is guaranteed to be unique. It can be used for creating CloudWatch Alarms. Only available when stream_enabled = true
StreamViewType string
When an item in the table is modified, StreamViewType determines what information is written to the table’s stream. Valid values are KEYS_ONLY, NEW_IMAGE, OLD_IMAGE, NEW_AND_OLD_IMAGES.
Tags map[string]string
A 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.
TagsAll map[string]string
A map of tags assigned to the resource, including those inherited from the provider .
Ttl TableTtlArgs
Defines ttl, has two properties, and can only be specified once:
WriteCapacity int
The number of write units for this index. Must be set if billing_mode is set to PROVISIONED.
arn string
The arn of the table
attributes TableAttributeArgs[]
List of nested attribute definitions. Only required for hash_key and range_key attributes. Each attribute has two properties:
billingMode string
Controls how you are charged for read and write throughput and how you manage capacity. The valid values are PROVISIONED and PAY_PER_REQUEST. Defaults to PROVISIONED.
globalSecondaryIndexes TableGlobalSecondaryIndexArgs[]
Describe a GSI for the table; subject to the normal limits on the number of GSIs, projected attributes, etc.
hashKey string
The name of the hash key in the index; must be defined as an attribute in the resource.
localSecondaryIndexes TableLocalSecondaryIndexArgs[]
Describe an LSI on the table; these can only be allocated at creation so you cannot change this definition after you have created the resource.
name string
The name of the index
pointInTimeRecovery TablePointInTimeRecoveryArgs
Point-in-time recovery options.
rangeKey string
The name of the range key; must be defined
readCapacity number
The number of read units for this index. Must be set if billing_mode is set to PROVISIONED.
replicas TableReplicaArgs[]
Configuration block(s) with DynamoDB Global Tables V2 (version 2019.11.21) replication configurations. Detailed below.
serverSideEncryption TableServerSideEncryptionArgs
Encryption at rest options. AWS DynamoDB tables are automatically encrypted at rest with an AWS owned Customer Master Key if this argument isn’t specified.
streamArn string
The ARN of the Table Stream. Only available when stream_enabled = true
streamEnabled boolean
Indicates whether Streams are to be enabled (true) or disabled (false).
streamLabel string
A timestamp, in ISO 8601 format, for this stream. Note that this timestamp is not a unique identifier for the stream on its own. However, the combination of AWS customer ID, table name and this field is guaranteed to be unique. It can be used for creating CloudWatch Alarms. Only available when stream_enabled = true
streamViewType string
When an item in the table is modified, StreamViewType determines what information is written to the table’s stream. Valid values are KEYS_ONLY, NEW_IMAGE, OLD_IMAGE, NEW_AND_OLD_IMAGES.
tags {[key: string]: string}
A 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.
tagsAll {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider .
ttl TableTtlArgs
Defines ttl, has two properties, and can only be specified once:
writeCapacity number
The number of write units for this index. Must be set if billing_mode is set to PROVISIONED.
arn str
The arn of the table
attributes Sequence[TableAttributeArgs]
List of nested attribute definitions. Only required for hash_key and range_key attributes. Each attribute has two properties:
billing_mode str
Controls how you are charged for read and write throughput and how you manage capacity. The valid values are PROVISIONED and PAY_PER_REQUEST. Defaults to PROVISIONED.
global_secondary_indexes Sequence[TableGlobalSecondaryIndexArgs]
Describe a GSI for the table; subject to the normal limits on the number of GSIs, projected attributes, etc.
hash_key str
The name of the hash key in the index; must be defined as an attribute in the resource.
local_secondary_indexes Sequence[TableLocalSecondaryIndexArgs]
Describe an LSI on the table; these can only be allocated at creation so you cannot change this definition after you have created the resource.
name str
The name of the index
point_in_time_recovery TablePointInTimeRecoveryArgs
Point-in-time recovery options.
range_key str
The name of the range key; must be defined
read_capacity int
The number of read units for this index. Must be set if billing_mode is set to PROVISIONED.
replicas Sequence[TableReplicaArgs]
Configuration block(s) with DynamoDB Global Tables V2 (version 2019.11.21) replication configurations. Detailed below.
server_side_encryption TableServerSideEncryptionArgs
Encryption at rest options. AWS DynamoDB tables are automatically encrypted at rest with an AWS owned Customer Master Key if this argument isn’t specified.
stream_arn str
The ARN of the Table Stream. Only available when stream_enabled = true
stream_enabled bool
Indicates whether Streams are to be enabled (true) or disabled (false).
stream_label str
A timestamp, in ISO 8601 format, for this stream. Note that this timestamp is not a unique identifier for the stream on its own. However, the combination of AWS customer ID, table name and this field is guaranteed to be unique. It can be used for creating CloudWatch Alarms. Only available when stream_enabled = true
stream_view_type str
When an item in the table is modified, StreamViewType determines what information is written to the table’s stream. Valid values are KEYS_ONLY, NEW_IMAGE, OLD_IMAGE, NEW_AND_OLD_IMAGES.
tags Mapping[str, str]
A 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.
tags_all Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider .
ttl TableTtlArgs
Defines ttl, has two properties, and can only be specified once:
write_capacity int
The number of write units for this index. Must be set if billing_mode is set to PROVISIONED.

Supporting Types

TableAttribute

Name string
The name of the index
Type string
Attribute type, which must be a scalar type: S, N, or B for (S)tring, (N)umber or (B)inary data
Name string
The name of the index
Type string
Attribute type, which must be a scalar type: S, N, or B for (S)tring, (N)umber or (B)inary data
name string
The name of the index
type string
Attribute type, which must be a scalar type: S, N, or B for (S)tring, (N)umber or (B)inary data
name str
The name of the index
type str
Attribute type, which must be a scalar type: S, N, or B for (S)tring, (N)umber or (B)inary data

TableGlobalSecondaryIndex

HashKey string
The name of the hash key in the index; must be defined as an attribute in the resource.
Name string
The name of the index
ProjectionType string
One of ALL, INCLUDE or KEYS_ONLY where ALL projects every attribute into the index, KEYS_ONLY projects just the hash and range key into the index, and INCLUDE projects only the keys specified in the non_key_attributes parameter.
NonKeyAttributes List<string>
Only required with INCLUDE as a projection type; a list of attributes to project into the index. These do not need to be defined as attributes on the table.
RangeKey string
The name of the range key; must be defined
ReadCapacity int
The number of read units for this index. Must be set if billing_mode is set to PROVISIONED.
WriteCapacity int
The number of write units for this index. Must be set if billing_mode is set to PROVISIONED.
HashKey string
The name of the hash key in the index; must be defined as an attribute in the resource.
Name string
The name of the index
ProjectionType string
One of ALL, INCLUDE or KEYS_ONLY where ALL projects every attribute into the index, KEYS_ONLY projects just the hash and range key into the index, and INCLUDE projects only the keys specified in the non_key_attributes parameter.
NonKeyAttributes []string
Only required with INCLUDE as a projection type; a list of attributes to project into the index. These do not need to be defined as attributes on the table.
RangeKey string
The name of the range key; must be defined
ReadCapacity int
The number of read units for this index. Must be set if billing_mode is set to PROVISIONED.
WriteCapacity int
The number of write units for this index. Must be set if billing_mode is set to PROVISIONED.
hashKey string
The name of the hash key in the index; must be defined as an attribute in the resource.
name string
The name of the index
projectionType string
One of ALL, INCLUDE or KEYS_ONLY where ALL projects every attribute into the index, KEYS_ONLY projects just the hash and range key into the index, and INCLUDE projects only the keys specified in the non_key_attributes parameter.
nonKeyAttributes string[]
Only required with INCLUDE as a projection type; a list of attributes to project into the index. These do not need to be defined as attributes on the table.
rangeKey string
The name of the range key; must be defined
readCapacity number
The number of read units for this index. Must be set if billing_mode is set to PROVISIONED.
writeCapacity number
The number of write units for this index. Must be set if billing_mode is set to PROVISIONED.
hash_key str
The name of the hash key in the index; must be defined as an attribute in the resource.
name str
The name of the index
projection_type str
One of ALL, INCLUDE or KEYS_ONLY where ALL projects every attribute into the index, KEYS_ONLY projects just the hash and range key into the index, and INCLUDE projects only the keys specified in the non_key_attributes parameter.
non_key_attributes Sequence[str]
Only required with INCLUDE as a projection type; a list of attributes to project into the index. These do not need to be defined as attributes on the table.
range_key str
The name of the range key; must be defined
read_capacity int
The number of read units for this index. Must be set if billing_mode is set to PROVISIONED.
write_capacity int
The number of write units for this index. Must be set if billing_mode is set to PROVISIONED.

TableLocalSecondaryIndex

Name string
The name of the index
ProjectionType string
One of ALL, INCLUDE or KEYS_ONLY where ALL projects every attribute into the index, KEYS_ONLY projects just the hash and range key into the index, and INCLUDE projects only the keys specified in the non_key_attributes parameter.
RangeKey string
The name of the range key; must be defined
NonKeyAttributes List<string>
Only required with INCLUDE as a projection type; a list of attributes to project into the index. These do not need to be defined as attributes on the table.
Name string
The name of the index
ProjectionType string
One of ALL, INCLUDE or KEYS_ONLY where ALL projects every attribute into the index, KEYS_ONLY projects just the hash and range key into the index, and INCLUDE projects only the keys specified in the non_key_attributes parameter.
RangeKey string
The name of the range key; must be defined
NonKeyAttributes []string
Only required with INCLUDE as a projection type; a list of attributes to project into the index. These do not need to be defined as attributes on the table.
name string
The name of the index
projectionType string
One of ALL, INCLUDE or KEYS_ONLY where ALL projects every attribute into the index, KEYS_ONLY projects just the hash and range key into the index, and INCLUDE projects only the keys specified in the non_key_attributes parameter.
rangeKey string
The name of the range key; must be defined
nonKeyAttributes string[]
Only required with INCLUDE as a projection type; a list of attributes to project into the index. These do not need to be defined as attributes on the table.
name str
The name of the index
projection_type str
One of ALL, INCLUDE or KEYS_ONLY where ALL projects every attribute into the index, KEYS_ONLY projects just the hash and range key into the index, and INCLUDE projects only the keys specified in the non_key_attributes parameter.
range_key str
The name of the range key; must be defined
non_key_attributes Sequence[str]
Only required with INCLUDE as a projection type; a list of attributes to project into the index. These do not need to be defined as attributes on the table.

TablePointInTimeRecovery

Enabled bool
Indicates whether ttl is enabled (true) or disabled (false).
Enabled bool
Indicates whether ttl is enabled (true) or disabled (false).
enabled boolean
Indicates whether ttl is enabled (true) or disabled (false).
enabled bool
Indicates whether ttl is enabled (true) or disabled (false).

TableReplica

RegionName string
Region name of the replica.
KmsKeyArn string
The ARN of the CMK that should be used for the AWS KMS encryption. This attribute should only be specified if the key is different from the default DynamoDB CMK, alias/aws/dynamodb.
RegionName string
Region name of the replica.
KmsKeyArn string
The ARN of the CMK that should be used for the AWS KMS encryption. This attribute should only be specified if the key is different from the default DynamoDB CMK, alias/aws/dynamodb.
regionName string
Region name of the replica.
kmsKeyArn string
The ARN of the CMK that should be used for the AWS KMS encryption. This attribute should only be specified if the key is different from the default DynamoDB CMK, alias/aws/dynamodb.
region_name str
Region name of the replica.
kms_key_arn str
The ARN of the CMK that should be used for the AWS KMS encryption. This attribute should only be specified if the key is different from the default DynamoDB CMK, alias/aws/dynamodb.

TableServerSideEncryption

Enabled bool
Indicates whether ttl is enabled (true) or disabled (false).
KmsKeyArn string
The ARN of the CMK that should be used for the AWS KMS encryption. This attribute should only be specified if the key is different from the default DynamoDB CMK, alias/aws/dynamodb.
Enabled bool
Indicates whether ttl is enabled (true) or disabled (false).
KmsKeyArn string
The ARN of the CMK that should be used for the AWS KMS encryption. This attribute should only be specified if the key is different from the default DynamoDB CMK, alias/aws/dynamodb.
enabled boolean
Indicates whether ttl is enabled (true) or disabled (false).
kmsKeyArn string
The ARN of the CMK that should be used for the AWS KMS encryption. This attribute should only be specified if the key is different from the default DynamoDB CMK, alias/aws/dynamodb.
enabled bool
Indicates whether ttl is enabled (true) or disabled (false).
kms_key_arn str
The ARN of the CMK that should be used for the AWS KMS encryption. This attribute should only be specified if the key is different from the default DynamoDB CMK, alias/aws/dynamodb.

TableTtl

AttributeName string
The name of the table attribute to store the TTL timestamp in.
Enabled bool
Indicates whether ttl is enabled (true) or disabled (false).
KmsKeyArn string
The ARN of the CMK that should be used for the AWS KMS encryption. This attribute should only be specified if the key is different from the default DynamoDB CMK, alias/aws/dynamodb.
AttributeName string
The name of the table attribute to store the TTL timestamp in.
Enabled bool
Indicates whether ttl is enabled (true) or disabled (false).
KmsKeyArn string
The ARN of the CMK that should be used for the AWS KMS encryption. This attribute should only be specified if the key is different from the default DynamoDB CMK, alias/aws/dynamodb.
attributeName string
The name of the table attribute to store the TTL timestamp in.
enabled boolean
Indicates whether ttl is enabled (true) or disabled (false).
kmsKeyArn string
The ARN of the CMK that should be used for the AWS KMS encryption. This attribute should only be specified if the key is different from the default DynamoDB CMK, alias/aws/dynamodb.
attribute_name str
The name of the table attribute to store the TTL timestamp in.
enabled bool
Indicates whether ttl is enabled (true) or disabled (false).
kms_key_arn str
The ARN of the CMK that should be used for the AWS KMS encryption. This attribute should only be specified if the key is different from the default DynamoDB CMK, alias/aws/dynamodb.

Import

DynamoDB tables can be imported using the name, e.g.

 $ pulumi import aws:dynamodb/table:Table basic-dynamodb-table GameScores

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.