awsdynamodb

package
v2.132.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 13 Imported by: 40

README

Amazon DynamoDB Construct Library

The DynamoDB construct library has two table constructs - Table and TableV2. TableV2 is the preferred construct for all use cases, including creating a single table or a table with multiple replicas.

Table API documentation

Here is a minimal deployable DynamoDB table using TableV2:

table := dynamodb.NewTableV2(this, jsii.String("Table"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
})

By default, TableV2 will create a single table in the main deployment region referred to as the primary table. The properties of the primary table are configurable via TableV2 properties. For example, consider the following DynamoDB table created using the TableV2 construct defined in a Stack being deployed to us-west-2:

table := dynamodb.NewTableV2(this, jsii.String("Table"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	ContributorInsights: jsii.Boolean(true),
	TableClass: dynamodb.TableClass_STANDARD_INFREQUENT_ACCESS,
	PointInTimeRecovery: jsii.Boolean(true),
})

The above TableV2 definition will result in the provisioning of a single table in us-west-2 with properties that match the properties set on the TableV2 instance.

Further reading: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GlobalTables.html

Replicas

The TableV2 construct can be configured with replica tables. This will enable you to work with your table as a global table. To do this, the TableV2 construct must be defined in a Stack with a defined region. The main deployment region must not be given as a replica because this is created by default with the TableV2 construct. The following is a minimal example of defining TableV2 with replicas. This TableV2 definition will provision three copies of the table - one in us-west-2 (primary deployment region), one in us-east-1, and one in us-east-2.

import "github.com/aws/aws-cdk-go/awscdk"


app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"), &StackProps{
	Env: &Environment{
		Region: jsii.String("us-west-2"),
	},
})

globalTable := dynamodb.NewTableV2(stack, jsii.String("GlobalTable"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	Replicas: []replicaTableProps{
		&replicaTableProps{
			Region: jsii.String("us-east-1"),
		},
		&replicaTableProps{
			Region: jsii.String("us-east-2"),
		},
	},
})

Alternatively, you can add new replicas to an instance of the TableV2 construct using the addReplica method:

import "github.com/aws/aws-cdk-go/awscdk"


app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"), &StackProps{
	Env: &Environment{
		Region: jsii.String("us-west-2"),
	},
})

globalTable := dynamodb.NewTableV2(stack, jsii.String("GlobalTable"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	Replicas: []replicaTableProps{
		&replicaTableProps{
			Region: jsii.String("us-east-1"),
		},
	},
})

globalTable.AddReplica(&replicaTableProps{
	Region: jsii.String("us-east-2"),
	DeletionProtection: jsii.Boolean(true),
})

The following properties are configurable on a per-replica basis, but will be inherited from the TableV2 properties if not specified:

  • contributorInsights
  • deletionProtection
  • pointInTimeRecovery
  • tableClass
  • readCapacity (only configurable if the TableV2 billing mode is PROVISIONED)
  • globalSecondaryIndexes (only contributorInsights and readCapacity)

The following example shows how to define properties on a per-replica basis:

import "github.com/aws/aws-cdk-go/awscdk"


app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"), &StackProps{
	Env: &Environment{
		Region: jsii.String("us-west-2"),
	},
})

globalTable := dynamodb.NewTableV2(stack, jsii.String("GlobalTable"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	ContributorInsights: jsii.Boolean(true),
	PointInTimeRecovery: jsii.Boolean(true),
	Replicas: []replicaTableProps{
		&replicaTableProps{
			Region: jsii.String("us-east-1"),
			TableClass: dynamodb.TableClass_STANDARD_INFREQUENT_ACCESS,
			PointInTimeRecovery: jsii.Boolean(false),
		},
		&replicaTableProps{
			Region: jsii.String("us-east-2"),
			ContributorInsights: jsii.Boolean(false),
		},
	},
})

To obtain an ITableV2 reference to a specific replica table, call the replica method on an instance of the TableV2 construct and pass the replica region as an argument:

import "github.com/aws/aws-cdk-go/awscdk"

var user user


type fooStack struct {
	stack
	globalTable tableV2
}

func newFooStack(scope construct, id *string, props stackProps) *fooStack {
	this := &fooStack{}
	cdk.NewStack_Override(this, scope, id, props)

	this.globalTable = dynamodb.NewTableV2(this, jsii.String("GlobalTable"), &TablePropsV2{
		PartitionKey: &Attribute{
			Name: jsii.String("pk"),
			Type: dynamodb.AttributeType_STRING,
		},
		Replicas: []replicaTableProps{
			&replicaTableProps{
				Region: jsii.String("us-east-1"),
			},
			&replicaTableProps{
				Region: jsii.String("us-east-2"),
			},
		},
	})
	return this
}

type barStackProps struct {
	stackProps
	replicaTable iTableV2
}

type barStack struct {
	stack
}

func newBarStack(scope construct, id *string, props barStackProps) *barStack {
	this := &barStack{}
	cdk.NewStack_Override(this, scope, id, props)

	// user is given grantWriteData permissions to replica in us-east-1
	*props.replicaTable.GrantWriteData(user)
	return this
}

app := cdk.NewApp()

fooStack := NewFooStack(app, jsii.String("FooStack"), &stackProps{
	Env: &Environment{
		Region: jsii.String("us-west-2"),
	},
})
barStack := NewBarStack(app, jsii.String("BarStack"), &barStackProps{
	replicaTable: fooStack.globalTable.Replica(jsii.String("us-east-1")),
	env: &Environment{
		Region: jsii.String("us-east-1"),
	},
})

Note: You can create an instance of the TableV2 construct with as many replicas as needed as long as there is only one replica per region. After table creation you can add or remove replicas, but you can only add or remove a single replica in each update.

Billing

The TableV2 construct can be configured with on-demand or provisioned billing:

  • On-demand - The default option. This is a flexible billing option capable of serving requests without capacity planning. The billing mode will be PAY_PER_REQUEST.

  • Provisioned - Specify the readCapacity and writeCapacity that you need for your application. The billing mode will be PROVISIONED. Capacity can be configured using one of the following modes:

    • Fixed - provisioned throughput capacity is configured with a fixed number of I/O operations per second.
    • Autoscaled - provisioned throughput capacity is dynamically adjusted on your behalf in response to actual traffic patterns.

Note: writeCapacity can only be configured using autoscaled capacity.

The following example shows how to configure TableV2 with on-demand billing:

table := dynamodb.NewTableV2(this, jsii.String("Table"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	Billing: dynamodb.Billing_OnDemand(),
})

When using provisioned billing, you must also specify readCapacity and writeCapacity. You can choose to configure readCapacity with fixed capacity or autoscaled capacity, but writeCapacity can only be configured with autoscaled capacity. The following example shows how to configure TableV2 with provisioned billing:

table := dynamodb.NewTableV2(this, jsii.String("Table"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	Billing: dynamodb.Billing_Provisioned(&ThroughputProps{
		ReadCapacity: dynamodb.Capacity_Fixed(jsii.Number(10)),
		WriteCapacity: dynamodb.Capacity_Autoscaled(&AutoscaledCapacityOptions{
			MaxCapacity: jsii.Number(15),
		}),
	}),
})

When using provisioned billing, you can configure the readCapacity on a per-replica basis:

import "github.com/aws/aws-cdk-go/awscdk"


app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"), &StackProps{
	Env: &Environment{
		Region: jsii.String("us-west-2"),
	},
})

globalTable := dynamodb.NewTableV2(stack, jsii.String("GlobalTable"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	Billing: dynamodb.Billing_Provisioned(&ThroughputProps{
		ReadCapacity: dynamodb.Capacity_Fixed(jsii.Number(10)),
		WriteCapacity: dynamodb.Capacity_Autoscaled(&AutoscaledCapacityOptions{
			MaxCapacity: jsii.Number(15),
		}),
	}),
	Replicas: []replicaTableProps{
		&replicaTableProps{
			Region: jsii.String("us-east-1"),
		},
		&replicaTableProps{
			Region: jsii.String("us-east-2"),
			ReadCapacity: dynamodb.Capacity_*Autoscaled(&AutoscaledCapacityOptions{
				MaxCapacity: jsii.Number(20),
				TargetUtilizationPercent: jsii.Number(50),
			}),
		},
	},
})

When changing the billing for a table from provisioned to on-demand or from on-demand to provisioned, seedCapacity must be configured for each autoscaled resource:

globalTable := dynamodb.NewTableV2(this, jsii.String("Table"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	Billing: dynamodb.Billing_Provisioned(&ThroughputProps{
		ReadCapacity: dynamodb.Capacity_Fixed(jsii.Number(10)),
		WriteCapacity: dynamodb.Capacity_Autoscaled(&AutoscaledCapacityOptions{
			MaxCapacity: jsii.Number(10),
			SeedCapacity: jsii.Number(20),
		}),
	}),
})

Further reading: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html

Encryption

All user data stored in a DynamoDB table is fully encrypted at rest. When creating an instance of the TableV2 construct, you can select the following table encryption options:

  • AWS owned keys - Default encryption type. The keys are owned by DynamoDB (no additional charge).
  • AWS managed keys - The keys are stored in your account and are managed by AWS KMS (AWS KMS charges apply).
  • Customer managed keys - The keys are stored in your account and are created, owned, and managed by you. You have full control over the KMS keys (AWS KMS charges apply).

The following is an example of how to configure TableV2 with encryption using an AWS owned key:

table := dynamodb.NewTableV2(this, jsii.String("Table"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	Encryption: dynamodb.TableEncryptionV2_DynamoOwnedKey(),
})

The following is an example of how to configure TableV2 with encryption using an AWS managed key:

table := dynamodb.NewTableV2(this, jsii.String("Table"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	Encryption: dynamodb.TableEncryptionV2_AwsManagedKey(),
})

When configuring TableV2 with encryption using customer managed keys, you must specify the KMS key for the primary table as the tableKey. A map of replicaKeyArns must be provided containing each replica region and the associated KMS key ARN:

import "github.com/aws/aws-cdk-go/awscdk"
import kms "github.com/aws/aws-cdk-go/awscdk"


app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"), &StackProps{
	Env: &Environment{
		Region: jsii.String("us-west-2"),
	},
})

tableKey := kms.NewKey(stack, jsii.String("Key"))
replicaKeyArns := map[string]*string{
	"us-east-1": jsii.String("arn:aws:kms:us-east-1:123456789012:key/g24efbna-az9b-42ro-m3bp-cq249l94fca6"),
	"us-east-2": jsii.String("arn:aws:kms:us-east-2:123456789012:key/h90bkasj-bs1j-92wp-s2ka-bh857d60bkj8"),
}

globalTable := dynamodb.NewTableV2(stack, jsii.String("GlobalTable"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	Encryption: dynamodb.TableEncryptionV2_CustomerManagedKey(tableKey, replicaKeyArns),
	Replicas: []replicaTableProps{
		&replicaTableProps{
			Region: jsii.String("us-east-1"),
		},
		&replicaTableProps{
			Region: jsii.String("us-east-2"),
		},
	},
})

Note: When encryption is configured with customer managed keys, you must have a key already created in each replica region.

Further reading: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-mgmt

Secondary Indexes

Secondary indexes allow efficient access to data with attributes other than the primaryKey. DynamoDB supports two types of secondary indexes:

  • Global secondary index - An index with a partitionKey and a sortKey that can be different from those on the base table. A globalSecondaryIndex is considered "global" because queries on the index can span all of the data in the base table, across all partitions. A globalSecondaryIndex is stored in its own partition space away from the base table and scales separately from the base table.
  • Local secondary index - An index that has the same partitionKey as the base table, but a different sortKey. A localSecondaryIndex is "local" in the sense that every partition of a localSecondaryIndex is scoped to a base table partition that has the same partitionKey value.

Further reading: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/SecondaryIndexes.html

Global Secondary Indexes

TableV2 can be configured with globalSecondaryIndexes by providing them as a TableV2 property:

table := dynamodb.NewTableV2(this, jsii.String("Table"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	GlobalSecondaryIndexes: []globalSecondaryIndexPropsV2{
		&globalSecondaryIndexPropsV2{
			IndexName: jsii.String("gsi"),
			PartitionKey: &Attribute{
				Name: jsii.String("pk"),
				Type: dynamodb.AttributeType_STRING,
			},
		},
	},
})

Alternatively, you can add a globalSecondaryIndex using the addGlobalSecondaryIndex method:

table := dynamodb.NewTableV2(this, jsii.String("Table"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	GlobalSecondaryIndexes: []globalSecondaryIndexPropsV2{
		&globalSecondaryIndexPropsV2{
			IndexName: jsii.String("gsi1"),
			PartitionKey: &Attribute{
				Name: jsii.String("pk"),
				Type: dynamodb.AttributeType_STRING,
			},
		},
	},
})

table.AddGlobalSecondaryIndex(&globalSecondaryIndexPropsV2{
	IndexName: jsii.String("gsi2"),
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
})

You can configure readCapacity and writeCapacity on a globalSecondaryIndex when an TableV2 is configured with provisioned billing. If TableV2 is configured with provisioned billing but readCapacity or writeCapacity are not configured on a globalSecondaryIndex, then they will be inherited from the capacity settings specified with the billing configuration:

table := dynamodb.NewTableV2(this, jsii.String("Table"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	Billing: dynamodb.Billing_Provisioned(&ThroughputProps{
		ReadCapacity: dynamodb.Capacity_Fixed(jsii.Number(10)),
		WriteCapacity: dynamodb.Capacity_Autoscaled(&AutoscaledCapacityOptions{
			MaxCapacity: jsii.Number(10),
		}),
	}),
	GlobalSecondaryIndexes: []globalSecondaryIndexPropsV2{
		&globalSecondaryIndexPropsV2{
			IndexName: jsii.String("gsi1"),
			PartitionKey: &Attribute{
				Name: jsii.String("pk"),
				Type: dynamodb.AttributeType_STRING,
			},
			ReadCapacity: dynamodb.Capacity_*Fixed(jsii.Number(15)),
		},
		&globalSecondaryIndexPropsV2{
			IndexName: jsii.String("gsi2"),
			PartitionKey: &Attribute{
				Name: jsii.String("pk"),
				Type: dynamodb.AttributeType_STRING,
			},
			WriteCapacity: dynamodb.Capacity_*Autoscaled(&AutoscaledCapacityOptions{
				MinCapacity: jsii.Number(5),
				MaxCapacity: jsii.Number(20),
			}),
		},
	},
})

All globalSecondaryIndexes for replica tables are inherited from the primary table. You can configure contributorInsights and readCapacity for each globalSecondaryIndex on a per-replica basis:

import "github.com/aws/aws-cdk-go/awscdk"


app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"), &StackProps{
	Env: &Environment{
		Region: jsii.String("us-west-2"),
	},
})

globalTable := dynamodb.NewTableV2(stack, jsii.String("GlobalTable"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	ContributorInsights: jsii.Boolean(true),
	Billing: dynamodb.Billing_Provisioned(&ThroughputProps{
		ReadCapacity: dynamodb.Capacity_Fixed(jsii.Number(10)),
		WriteCapacity: dynamodb.Capacity_Autoscaled(&AutoscaledCapacityOptions{
			MaxCapacity: jsii.Number(10),
		}),
	}),
	// each global secondary index will inherit contributor insights as true
	GlobalSecondaryIndexes: []globalSecondaryIndexPropsV2{
		&globalSecondaryIndexPropsV2{
			IndexName: jsii.String("gsi1"),
			PartitionKey: &Attribute{
				Name: jsii.String("pk"),
				Type: dynamodb.AttributeType_STRING,
			},
			ReadCapacity: dynamodb.Capacity_*Fixed(jsii.Number(15)),
		},
		&globalSecondaryIndexPropsV2{
			IndexName: jsii.String("gsi2"),
			PartitionKey: &Attribute{
				Name: jsii.String("pk"),
				Type: dynamodb.AttributeType_STRING,
			},
			WriteCapacity: dynamodb.Capacity_*Autoscaled(&AutoscaledCapacityOptions{
				MinCapacity: jsii.Number(5),
				MaxCapacity: jsii.Number(20),
			}),
		},
	},
	Replicas: []replicaTableProps{
		&replicaTableProps{
			Region: jsii.String("us-east-1"),
			GlobalSecondaryIndexOptions: map[string]replicaGlobalSecondaryIndexOptions{
				"gsi1": &replicaGlobalSecondaryIndexOptions{
					"readCapacity": dynamodb.Capacity_*Autoscaled(&AutoscaledCapacityOptions{
						"minCapacity": jsii.Number(1),
						"maxCapacity": jsii.Number(10),
					}),
				},
			},
		},
		&replicaTableProps{
			Region: jsii.String("us-east-2"),
			GlobalSecondaryIndexOptions: map[string]*replicaGlobalSecondaryIndexOptions{
				"gsi2": &replicaGlobalSecondaryIndexOptions{
					"contributorInsights": jsii.Boolean(false),
				},
			},
		},
	},
})
Local Secondary Indexes

TableV2 can only be configured with localSecondaryIndexes when a sortKey is defined as a TableV2 property.

You can provide localSecondaryIndexes as a TableV2 property:

table := dynamodb.NewTableV2(this, jsii.String("Table"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	SortKey: &Attribute{
		Name: jsii.String("sk"),
		Type: dynamodb.AttributeType_NUMBER,
	},
	LocalSecondaryIndexes: []localSecondaryIndexProps{
		&localSecondaryIndexProps{
			IndexName: jsii.String("lsi"),
			SortKey: &Attribute{
				Name: jsii.String("sk"),
				Type: dynamodb.AttributeType_NUMBER,
			},
		},
	},
})

Alternatively, you can add a localSecondaryIndex using the addLocalSecondaryIndex method:

table := dynamodb.NewTableV2(this, jsii.String("Table"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	SortKey: &Attribute{
		Name: jsii.String("sk"),
		Type: dynamodb.AttributeType_NUMBER,
	},
	LocalSecondaryIndexes: []localSecondaryIndexProps{
		&localSecondaryIndexProps{
			IndexName: jsii.String("lsi1"),
			SortKey: &Attribute{
				Name: jsii.String("sk"),
				Type: dynamodb.AttributeType_NUMBER,
			},
		},
	},
})

table.AddLocalSecondaryIndex(&localSecondaryIndexProps{
	IndexName: jsii.String("lsi2"),
	SortKey: &Attribute{
		Name: jsii.String("sk"),
		Type: dynamodb.AttributeType_NUMBER,
	},
})

Streams

Each DynamoDB table produces an independent stream based on all its writes, regardless of the origination point for those writes. DynamoDB supports two stream types:

  • DynamoDB streams - Capture item-level changes in your table, and push the changes to a DynamoDB stream. You then can access the change information through the DynamoDB Streams API.
  • Kinesis streams - Amazon Kinesis Data Streams for DynamoDB captures item-level changes in your table, and replicates the changes to a Kinesis data stream. You then can consume and manage the change information from Kinesis.
DynamoDB Streams

A dynamoStream can be configured as a TableV2 property. If the TableV2 instance has replica tables, then all replica tables will inherit the dynamoStream setting from the primary table. If replicas are configured, but dynamoStream is not configured, then the primary table and all replicas will be automatically configured with the NEW_AND_OLD_IMAGES stream view type.

import "github.com/aws/aws-cdk-go/awscdk"
import kinesis "github.com/aws/aws-cdk-go/awscdk"


app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"), &StackProps{
	Env: &Environment{
		Region: jsii.String("us-west-2"),
	},
})

globalTable := dynamodb.NewTableV2(this, jsii.String("GlobalTable"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("id"),
		Type: dynamodb.AttributeType_STRING,
	},
	DynamoStream: dynamodb.StreamViewType_OLD_IMAGE,
	// tables in us-west-2, us-east-1, and us-east-2 all have dynamo stream type of OLD_IMAGES
	Replicas: []replicaTableProps{
		&replicaTableProps{
			Region: jsii.String("us-east-1"),
		},
		&replicaTableProps{
			Region: jsii.String("us-east-2"),
		},
	},
})

Further reading: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Streams.html

Kinesis Streams

A kinesisStream can be configured as a TableV2 property. Replica tables will not inherit the kinesisStream configured for the primary table and should added on a per-replica basis.

import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"


app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"), &StackProps{
	Env: &Environment{
		Region: jsii.String("us-west-2"),
	},
})

stream1 := kinesis.NewStream(stack, jsii.String("Stream1"))
stream2 := kinesis.Stream_FromStreamArn(stack, jsii.String("Stream2"), jsii.String("arn:aws:kinesis:us-east-2:123456789012:stream/my-stream"))

globalTable := dynamodb.NewTableV2(this, jsii.String("GlobalTable"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("id"),
		Type: dynamodb.AttributeType_STRING,
	},
	KinesisStream: stream1,
	 // for table in us-west-2
	Replicas: []replicaTableProps{
		&replicaTableProps{
			Region: jsii.String("us-east-1"),
		},
		&replicaTableProps{
			Region: jsii.String("us-east-2"),
			KinesisStream: stream2,
		},
	},
})

Further reading: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/kds.html

Keys

When an instance of the TableV2 construct is defined, you must define its schema using the partitionKey (required) and sortKey (optional) properties.

table := dynamodb.NewTableV2(this, jsii.String("Table"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	SortKey: &Attribute{
		Name: jsii.String("sk"),
		Type: dynamodb.AttributeType_NUMBER,
	},
})

Contributor Insights

Enabling contributorInsights for TableV2 will provide information about the most accessed and throttled items in a table or globalSecondaryIndex. DynamoDB delivers this information to you via CloudWatch Contributor Insights rules, reports, and graphs of report data.

table := dynamodb.NewTableV2(this, jsii.String("Table"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	ContributorInsights: jsii.Boolean(true),
})

Further reading: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/contributorinsights_HowItWorks.html

Deletion Protection

deletionProtection determines if your DynamoDB table is protected from deletion and is configurable as a TableV2 property. When enabled, the table cannot be deleted by any user or process.

table := dynamodb.NewTableV2(this, jsii.String("Table"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	DeletionProtection: jsii.Boolean(true),
})

You can also specify the removalPolicy as a property of the TableV2 construct. This property allows you to control what happens to tables provisioned using TableV2 during stack deletion. By default, the removalPolicy is RETAIN which will cause all tables provisioned using TableV2 to be retained in the account, but orphaned from the stack they were created in. You can also set the removalPolicy to DESTROY which will delete all tables created using TableV2 during stack deletion:

import "github.com/aws/aws-cdk-go/awscdk"


app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"), &StackProps{
	Env: &Environment{
		Region: jsii.String("us-west-2"),
	},
})

globalTable := dynamodb.NewTableV2(stack, jsii.String("GlobalTable"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	// applys to all replicas, i.e., us-west-2, us-east-1, us-east-2
	RemovalPolicy: cdk.RemovalPolicy_DESTROY,
	Replicas: []replicaTableProps{
		&replicaTableProps{
			Region: jsii.String("us-east-1"),
		},
		&replicaTableProps{
			Region: jsii.String("us-east-2"),
		},
	},
})

deletionProtection is configurable on a per-replica basis. If the removalPolicy is set to DESTROY, but some replicas have deletionProtection enabled, then only the replicas without deletionProtection will be deleted during stack deletion:

import "github.com/aws/aws-cdk-go/awscdk"


app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"), &StackProps{
	Env: &Environment{
		Region: jsii.String("us-west-2"),
	},
})

globalTable := dynamodb.NewTableV2(stack, jsii.String("GlobalTable"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	RemovalPolicy: cdk.RemovalPolicy_DESTROY,
	DeletionProtection: jsii.Boolean(true),
	// only the replica in us-east-1 will be deleted during stack deletion
	Replicas: []replicaTableProps{
		&replicaTableProps{
			Region: jsii.String("us-east-1"),
			DeletionProtection: jsii.Boolean(false),
		},
		&replicaTableProps{
			Region: jsii.String("us-east-2"),
			DeletionProtection: jsii.Boolean(true),
		},
	},
})

Point-in-Time Recovery

pointInTimeRecovery provides automatic backups of your DynamoDB table data which helps protect your tables from accidental write or delete operations.

table := dynamodb.NewTableV2(this, jsii.String("Table"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	PointInTimeRecovery: jsii.Boolean(true),
})

Table Class

You can configure a TableV2 instance with table classes:

  • STANDARD - the default mode, and is recommended for the vast majority of workloads.
  • STANDARD_INFREQUENT_ACCESS - optimized for tables where storage is the dominant cost.
table := dynamodb.NewTableV2(this, jsii.String("Table"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	TableClass: dynamodb.TableClass_STANDARD_INFREQUENT_ACCESS,
})

Further reading: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.TableClasses.html

Tags

You can add tags to a TableV2 in several ways. By adding the tags to the construct itself it will apply the tags to the primary table.

table := dynamodb.NewTableV2(this, jsii.String("Table"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	Tags: []cfnTag{
		&cfnTag{
			Key: jsii.String("primaryTableTagKey"),
			Value: jsii.String("primaryTableTagValue"),
		},
	},
})

You can also add tags to replica tables by specifying them within the replica table properties.

table := dynamodb.NewTableV2(this, jsii.String("Table"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	Replicas: []replicaTableProps{
		&replicaTableProps{
			Region: jsii.String("us-west-1"),
			Tags: []cfnTag{
				&cfnTag{
					Key: jsii.String("replicaTableTagKey"),
					Value: jsii.String("replicaTableTagValue"),
				},
			},
		},
	},
})

Referencing Existing Global Tables

To reference an existing DynamoDB table in your CDK application, use the TableV2.fromTableName, TableV2.fromTableArn, or TableV2.fromTableAttributes factory methods:

var user user


table := dynamodb.TableV2_FromTableArn(this, jsii.String("ImportedTable"), jsii.String("arn:aws:dynamodb:us-east-1:123456789012:table/my-table"))
// now you can call methods on the referenced table
table.GrantReadWriteData(user)

If you intend to use the tableStreamArn (including indirectly, for example by creating an aws-cdk-lib/aws-lambda-event-sources.DynamoEventSource on the referenced table), you must use the TableV2.fromTableAttributes method and the tableStreamArn property must be populated.

To grant permissions to indexes for a referenced table you can either set grantIndexPermissions to true, or you can provide the indexes via the globalIndexes or localIndexes properties. This will enable grant* methods to also grant permissions to all table indexes.

Grants

Using any of the grant* methods on an instance of the TableV2 construct will only apply to the primary table, its indexes, and any associated encryptionKey. As an example, grantReadData used below will only apply the table in us-west-2:

import "github.com/aws/aws-cdk-go/awscdk"
import kms "github.com/aws/aws-cdk-go/awscdk"

var user user


app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"), &StackProps{
	Env: &Environment{
		Region: jsii.String("us-west-2"),
	},
})

tableKey := kms.NewKey(stack, jsii.String("Key"))
replicaKeyArns := map[string]*string{
	"us-east-1": jsii.String("arn:aws:kms:us-east-1:123456789012:key/g24efbna-az9b-42ro-m3bp-cq249l94fca6"),
	"us-east-2": jsii.String("arn:aws:kms:us-east-2:123456789012:key/g24efbna-az9b-42ro-m3bp-cq249l94fca6"),
}

globalTable := dynamodb.NewTableV2(stack, jsii.String("GlobalTable"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	Encryption: dynamodb.TableEncryptionV2_CustomerManagedKey(tableKey, replicaKeyArns),
	Replicas: []replicaTableProps{
		&replicaTableProps{
			Region: jsii.String("us-east-1"),
		},
		&replicaTableProps{
			Region: jsii.String("us-east-2"),
		},
	},
})

// grantReadData only applys to the table in us-west-2 and the tableKey
globalTable.GrantReadData(user)

The replica method can be used to grant to a specific replica table:

import "github.com/aws/aws-cdk-go/awscdk"
import kms "github.com/aws/aws-cdk-go/awscdk"

var user user


app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"), &StackProps{
	Env: &Environment{
		Region: jsii.String("us-west-2"),
	},
})

tableKey := kms.NewKey(stack, jsii.String("Key"))
replicaKeyArns := map[string]*string{
	"us-east-1": jsii.String("arn:aws:kms:us-east-1:123456789012:key/g24efbna-az9b-42ro-m3bp-cq249l94fca6"),
	"us-east-2": jsii.String("arn:aws:kms:us-east-2:123456789012:key/g24efbna-az9b-42ro-m3bp-cq249l94fca6"),
}

globalTable := dynamodb.NewTableV2(stack, jsii.String("GlobalTable"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	Encryption: dynamodb.TableEncryptionV2_CustomerManagedKey(tableKey, replicaKeyArns),
	Replicas: []replicaTableProps{
		&replicaTableProps{
			Region: jsii.String("us-east-1"),
		},
		&replicaTableProps{
			Region: jsii.String("us-east-2"),
		},
	},
})

// grantReadData applys to the table in us-east-2 and the key arn for the key in us-east-2
globalTable.Replica(jsii.String("us-east-2")).GrantReadData(user)

Metrics

You can use metric* methods to generate metrics for a table that can be used when configuring an Alarm or Graphs. The metric* methods only apply to the primary table provisioned using the TableV2 construct. As an example, metricConsumedReadCapacityUnits used below is only for the table in us-west-2:

import "github.com/aws/aws-cdk-go/awscdk"
import cloudwatch "github.com/aws/aws-cdk-go/awscdk"


app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"), &StackProps{
	Env: &Environment{
		Region: jsii.String("us-west-2"),
	},
})

globalTable := dynamodb.NewTableV2(stack, jsii.String("GlobalTable"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	Replicas: []replicaTableProps{
		&replicaTableProps{
			Region: jsii.String("us-east-1"),
		},
		&replicaTableProps{
			Region: jsii.String("us-east-2"),
		},
	},
})

// metric is only for the table in us-west-2
metric := globalTable.MetricConsumedReadCapacityUnits()

cloudwatch.NewAlarm(this, jsii.String("Alarm"), &AlarmProps{
	Metric: metric,
	EvaluationPeriods: jsii.Number(1),
	Threshold: jsii.Number(1),
})

The replica method can be used to generate a metric for a specific replica table:

import * as cdk form 'aws-cdk-lib';
import * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';

class FooStack extends cdk.Stack {
  public readonly globalTable: dynamodb.TableV2;

  public constructor(scope: Construct, id: string, props: cdk.StackProps) {
    super(scope, id, props);

    this.globalTable = new dynamodb.Tablev2(this, 'GlobalTable', {
      partitionKey: { name: 'pk', type: dynamodb.AttributeType.STRING },
      replicas: [
        { region: 'us-east-1' },
        { region: 'us-east-2' },
      ],
    });
  }
}

interface BarStack extends cdk.StackProps {
  readonly replicaTable: dynamodb.ITableV2;
}

class BarStack extends cdk.Stack {
  public constructor(scope: Construct, id: string, props: BarStackProps) {
    super(scope, id, props);

    // metric is only for the table in us-east-1
    const metric = props.replicaTable.metricConsumedReadCapacityUnits();

    new cloudwatch.Alarm(this, 'Alarm', {
      metric: metric,
      evaluationPeriods: 1,
      threshold: 1,
    });
  }
}

const app = new cdk.App();
const fooStack = new FooStack(app, 'FooStack', { env: { region: 'us-west-2' } });
const barStack = new BarStack(app, 'BarStack', {
  replicaTable: fooStack.globalTable.replica('us-east-1'),
  env: { region: 'us-east-1' },
});

import from S3 Bucket

You can import data in S3 when creating a Table using the Table construct. To import data into DynamoDB, it is required that your data is in a CSV, DynamoDB JSON, or Amazon Ion format within an Amazon S3 bucket. The data may be compressed using ZSTD or GZIP formats, or you may choose to import it without compression. The data source can be a single S3 object or multiple S3 objects sharing a common prefix.

Further reading: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/S3DataImport.HowItWorks.html

use CSV format

The InputFormat.csv method accepts delimiter and headerList options as arguments. If delimiter is not specified, , is used by default. And if headerList is specified, the first line of CSV is treated as data instead of header.

import "github.com/aws/aws-cdk-go/awscdk"
import s3 "github.com/aws/aws-cdk-go/awscdk"

var bucket iBucket


app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"))

dynamodb.NewTable(stack, jsii.String("Table"), &TableProps{
	PartitionKey: &Attribute{
		Name: jsii.String("id"),
		Type: dynamodb.AttributeType_STRING,
	},
	ImportSource: &ImportSourceSpecification{
		CompressionType: dynamodb.InputCompressionType_GZIP,
		InputFormat: dynamodb.InputFormat_Csv(&CsvOptions{
			Delimiter: jsii.String(","),
			HeaderList: []*string{
				jsii.String("id"),
				jsii.String("name"),
			},
		}),
		Bucket: *Bucket,
		KeyPrefix: jsii.String("prefix"),
	},
})
use DynamoDB JSON format

Use the InputFormat.dynamoDBJson() method to specify the inputFormat property. There are currently no options available.

import "github.com/aws/aws-cdk-go/awscdk"
import s3 "github.com/aws/aws-cdk-go/awscdk"

var bucket iBucket


app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"))

dynamodb.NewTable(stack, jsii.String("Table"), &TableProps{
	PartitionKey: &Attribute{
		Name: jsii.String("id"),
		Type: dynamodb.AttributeType_STRING,
	},
	ImportSource: &ImportSourceSpecification{
		CompressionType: dynamodb.InputCompressionType_GZIP,
		InputFormat: dynamodb.InputFormat_DynamoDBJson(),
		Bucket: *Bucket,
		KeyPrefix: jsii.String("prefix"),
	},
})
use Amazon Ion format

Use the InputFormat.ion() method to specify the inputFormat property. There are currently no options available.

import "github.com/aws/aws-cdk-go/awscdk"
import s3 "github.com/aws/aws-cdk-go/awscdk"

var bucket iBucket


app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"))

dynamodb.NewTable(stack, jsii.String("Table"), &TableProps{
	PartitionKey: &Attribute{
		Name: jsii.String("id"),
		Type: dynamodb.AttributeType_STRING,
	},
	ImportSource: &ImportSourceSpecification{
		CompressionType: dynamodb.InputCompressionType_GZIP,
		InputFormat: dynamodb.InputFormat_Ion(),
		Bucket: *Bucket,
		KeyPrefix: jsii.String("prefix"),
	},
})

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CfnGlobalTable_CFN_RESOURCE_TYPE_NAME

func CfnGlobalTable_CFN_RESOURCE_TYPE_NAME() *string

func CfnGlobalTable_IsCfnElement

func CfnGlobalTable_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element.

func CfnGlobalTable_IsCfnResource

func CfnGlobalTable_IsCfnResource(x interface{}) *bool

Check whether the given object is a CfnResource.

func CfnGlobalTable_IsConstruct

func CfnGlobalTable_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func CfnTable_CFN_RESOURCE_TYPE_NAME

func CfnTable_CFN_RESOURCE_TYPE_NAME() *string

func CfnTable_IsCfnElement

func CfnTable_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element.

func CfnTable_IsCfnResource

func CfnTable_IsCfnResource(x interface{}) *bool

Check whether the given object is a CfnResource.

func CfnTable_IsConstruct

func CfnTable_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func NewCfnGlobalTable_Override

func NewCfnGlobalTable_Override(c CfnGlobalTable, scope constructs.Construct, id *string, props *CfnGlobalTableProps)

func NewCfnTable_Override

func NewCfnTable_Override(c CfnTable, scope constructs.Construct, id *string, props *CfnTableProps)

func NewInputFormat_Override added in v2.123.0

func NewInputFormat_Override(i InputFormat)

func NewTableBaseV2_Override added in v2.95.0

func NewTableBaseV2_Override(t TableBaseV2, scope constructs.Construct, id *string, props *awscdk.ResourceProps)

func NewTableBase_Override added in v2.95.0

func NewTableBase_Override(t TableBase, scope constructs.Construct, id *string, props *awscdk.ResourceProps)

func NewTableV2_Override added in v2.95.0

func NewTableV2_Override(t TableV2, scope constructs.Construct, id *string, props *TablePropsV2)

func NewTable_Override

func NewTable_Override(t Table, scope constructs.Construct, id *string, props *TableProps)

func TableBaseV2_IsConstruct added in v2.95.0

func TableBaseV2_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func TableBaseV2_IsOwnedResource added in v2.95.0

func TableBaseV2_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise.

func TableBaseV2_IsResource added in v2.95.0

func TableBaseV2_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource.

func TableBase_IsConstruct added in v2.95.0

func TableBase_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func TableBase_IsOwnedResource added in v2.95.0

func TableBase_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise.

func TableBase_IsResource added in v2.95.0

func TableBase_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource.

func TableV2_IsConstruct added in v2.95.0

func TableV2_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func TableV2_IsOwnedResource added in v2.95.0

func TableV2_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise.

func TableV2_IsResource added in v2.95.0

func TableV2_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource.

func Table_IsConstruct

func Table_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func Table_IsOwnedResource added in v2.32.0

func Table_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise.

func Table_IsResource

func Table_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource.

Types

type Attribute

type Attribute struct {
	// The name of an attribute.
	Name *string `field:"required" json:"name" yaml:"name"`
	// The data type of an attribute.
	Type AttributeType `field:"required" json:"type" yaml:"type"`
}

Represents an attribute for describing the key schema for the table and indexes.

Example:

import "github.com/aws/aws-cdk-go/awscdk"

app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"), &StackProps{
	Env: &Environment{
		Region: jsii.String("us-west-2"),
	},
})

globalTable := dynamodb.NewTableV2(stack, jsii.String("GlobalTable"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	// applys to all replicas, i.e., us-west-2, us-east-1, us-east-2
	RemovalPolicy: cdk.RemovalPolicy_DESTROY,
	Replicas: []replicaTableProps{
		&replicaTableProps{
			Region: jsii.String("us-east-1"),
		},
		&replicaTableProps{
			Region: jsii.String("us-east-2"),
		},
	},
})

type AttributeType

type AttributeType string

Data types for attributes within a table.

Example:

import "github.com/aws/aws-cdk-go/awscdk"

app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"), &StackProps{
	Env: &Environment{
		Region: jsii.String("us-west-2"),
	},
})

globalTable := dynamodb.NewTableV2(stack, jsii.String("GlobalTable"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	// applys to all replicas, i.e., us-west-2, us-east-1, us-east-2
	RemovalPolicy: cdk.RemovalPolicy_DESTROY,
	Replicas: []replicaTableProps{
		&replicaTableProps{
			Region: jsii.String("us-east-1"),
		},
		&replicaTableProps{
			Region: jsii.String("us-east-2"),
		},
	},
})

See: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes

const (
	// Up to 400KiB of binary data (which must be encoded as base64 before sending to DynamoDB).
	AttributeType_BINARY AttributeType = "BINARY"
	// Numeric values made of up to 38 digits (positive, negative or zero).
	AttributeType_NUMBER AttributeType = "NUMBER"
	// Up to 400KiB of UTF-8 encoded text.
	AttributeType_STRING AttributeType = "STRING"
)

type AutoscaledCapacityOptions added in v2.95.0

type AutoscaledCapacityOptions struct {
	// The maximum allowable capacity.
	MaxCapacity *float64 `field:"required" json:"maxCapacity" yaml:"maxCapacity"`
	// The minimum allowable capacity.
	// Default: 1.
	//
	MinCapacity *float64 `field:"optional" json:"minCapacity" yaml:"minCapacity"`
	// If you want to switch a table's billing mode from on-demand to provisioned or from provisioned to on-demand, you must specify a value for this property for each autoscaled resource.
	// Default: no seed capacity.
	//
	SeedCapacity *float64 `field:"optional" json:"seedCapacity" yaml:"seedCapacity"`
	// The ratio of consumed capacity units to provisioned capacity units.
	//
	// Note: Target utilization percent cannot be less than 20 and cannot be greater
	// than 90.
	// Default: 70.
	//
	TargetUtilizationPercent *float64 `field:"optional" json:"targetUtilizationPercent" yaml:"targetUtilizationPercent"`
}

Options used to configure autoscaled capacity.

Example:

import "github.com/aws/aws-cdk-go/awscdk"

app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"), &StackProps{
	Env: &Environment{
		Region: jsii.String("us-west-2"),
	},
})

globalTable := dynamodb.NewTableV2(stack, jsii.String("GlobalTable"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	Billing: dynamodb.Billing_Provisioned(&ThroughputProps{
		ReadCapacity: dynamodb.Capacity_Fixed(jsii.Number(10)),
		WriteCapacity: dynamodb.Capacity_Autoscaled(&AutoscaledCapacityOptions{
			MaxCapacity: jsii.Number(15),
		}),
	}),
	Replicas: []replicaTableProps{
		&replicaTableProps{
			Region: jsii.String("us-east-1"),
		},
		&replicaTableProps{
			Region: jsii.String("us-east-2"),
			ReadCapacity: dynamodb.Capacity_*Autoscaled(&AutoscaledCapacityOptions{
				MaxCapacity: jsii.Number(20),
				TargetUtilizationPercent: jsii.Number(50),
			}),
		},
	},
})

type Billing added in v2.95.0

type Billing interface {
	Mode() BillingMode
}

Represents how capacity is managed and how you are charged for read and write throughput for a DynamoDB table.

Example:

import "github.com/aws/aws-cdk-go/awscdk"

app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"), &StackProps{
	Env: &Environment{
		Region: jsii.String("us-west-2"),
	},
})

globalTable := dynamodb.NewTableV2(stack, jsii.String("GlobalTable"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	Billing: dynamodb.Billing_Provisioned(&ThroughputProps{
		ReadCapacity: dynamodb.Capacity_Fixed(jsii.Number(10)),
		WriteCapacity: dynamodb.Capacity_Autoscaled(&AutoscaledCapacityOptions{
			MaxCapacity: jsii.Number(15),
		}),
	}),
	Replicas: []replicaTableProps{
		&replicaTableProps{
			Region: jsii.String("us-east-1"),
		},
		&replicaTableProps{
			Region: jsii.String("us-east-2"),
			ReadCapacity: dynamodb.Capacity_*Autoscaled(&AutoscaledCapacityOptions{
				MaxCapacity: jsii.Number(20),
				TargetUtilizationPercent: jsii.Number(50),
			}),
		},
	},
})

func Billing_OnDemand added in v2.95.0

func Billing_OnDemand() Billing

Flexible billing option capable of serving requests without capacity planning.

Note: Billing mode will be PAY_PER_REQUEST.

func Billing_Provisioned added in v2.95.0

func Billing_Provisioned(props *ThroughputProps) Billing

Specify the number of reads and writes per second that you need for your application.

type BillingMode

type BillingMode string

DynamoDB's Read/Write capacity modes.

const (
	// Pay only for what you use.
	//
	// You don't configure Read/Write capacity units.
	BillingMode_PAY_PER_REQUEST BillingMode = "PAY_PER_REQUEST"
	// Explicitly specified Read/Write capacity units.
	BillingMode_PROVISIONED BillingMode = "PROVISIONED"
)

type Capacity added in v2.95.0

type Capacity interface {
	Mode() CapacityMode
}

Represents the amount of read and write operations supported by a DynamoDB table.

Example:

import "github.com/aws/aws-cdk-go/awscdk"

app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"), &StackProps{
	Env: &Environment{
		Region: jsii.String("us-west-2"),
	},
})

globalTable := dynamodb.NewTableV2(stack, jsii.String("GlobalTable"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	Billing: dynamodb.Billing_Provisioned(&ThroughputProps{
		ReadCapacity: dynamodb.Capacity_Fixed(jsii.Number(10)),
		WriteCapacity: dynamodb.Capacity_Autoscaled(&AutoscaledCapacityOptions{
			MaxCapacity: jsii.Number(15),
		}),
	}),
	Replicas: []replicaTableProps{
		&replicaTableProps{
			Region: jsii.String("us-east-1"),
		},
		&replicaTableProps{
			Region: jsii.String("us-east-2"),
			ReadCapacity: dynamodb.Capacity_*Autoscaled(&AutoscaledCapacityOptions{
				MaxCapacity: jsii.Number(20),
				TargetUtilizationPercent: jsii.Number(50),
			}),
		},
	},
})

func Capacity_Autoscaled added in v2.95.0

func Capacity_Autoscaled(options *AutoscaledCapacityOptions) Capacity

Dynamically adjusts provisioned throughput capacity on your behalf in response to actual traffic patterns.

func Capacity_Fixed added in v2.95.0

func Capacity_Fixed(iops *float64) Capacity

Provisioned throughput capacity is configured with fixed capacity units.

Note: You cannot configure write capacity using fixed capacity mode.

type CapacityMode added in v2.95.0

type CapacityMode string

Capacity modes.

const (
	// Fixed.
	CapacityMode_FIXED CapacityMode = "FIXED"
	// Autoscaled.
	CapacityMode_AUTOSCALED CapacityMode = "AUTOSCALED"
)

type CfnGlobalTable

type CfnGlobalTable interface {
	awscdk.CfnResource
	awscdk.IInspectable
	// The Amazon Resource Name (ARN) of the DynamoDB table, such as `arn:aws:dynamodb:us-east-2:123456789012:table/myDynamoDBTable` .
	//
	// The ARN returned is that of the replica in the region the stack is deployed to.
	AttrArn() *string
	// A list of attributes that describe the key schema for the global table and indexes.
	AttributeDefinitions() interface{}
	SetAttributeDefinitions(val interface{})
	// The ARN of the DynamoDB stream, such as `arn:aws:dynamodb:us-east-1:123456789012:table/testddbstack-myDynamoDBTable-012A1SL7SMP5Q/stream/2015-11-30T20:10:00.000` . The `StreamArn` returned is that of the replica in the region the stack is deployed to.
	//
	// > You must specify the `StreamSpecification` property to use this attribute.
	AttrStreamArn() *string
	// Unique identifier for the table, such as `a123b456-01ab-23cd-123a-111222aaabbb` .
	//
	// The `TableId` returned is that of the replica in the region the stack is deployed to.
	AttrTableId() *string
	// Specifies how you are charged for read and write throughput and how you manage capacity.
	//
	// Valid values are:.
	BillingMode() *string
	SetBillingMode(val *string)
	// Options for this resource, such as condition, update policy etc.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	CfnResourceType() *string
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	CreationStack() *[]*string
	// Global secondary indexes to be created on the global table.
	GlobalSecondaryIndexes() interface{}
	SetGlobalSecondaryIndexes(val interface{})
	// Specifies the attributes that make up the primary key for the table.
	KeySchema() interface{}
	SetKeySchema(val interface{})
	// Local secondary indexes to be created on the table.
	LocalSecondaryIndexes() interface{}
	SetLocalSecondaryIndexes(val interface{})
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	LogicalId() *string
	// The tree node.
	Node() constructs.Node
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	Ref() *string
	// Specifies the list of replicas for your global table.
	Replicas() interface{}
	SetReplicas(val interface{})
	// Specifies the settings to enable server-side encryption.
	SseSpecification() interface{}
	SetSseSpecification(val interface{})
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	Stack() awscdk.Stack
	// Specifies the streams settings on your global table.
	StreamSpecification() interface{}
	SetStreamSpecification(val interface{})
	// A name for the global table.
	TableName() *string
	SetTableName(val *string)
	// Specifies the time to live (TTL) settings for the table.
	TimeToLiveSpecification() interface{}
	SetTimeToLiveSpecification(val interface{})
	// Deprecated.
	// Deprecated: use `updatedProperties`
	//
	// Return properties modified after initiation
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperites() *map[string]interface{}
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperties() *map[string]interface{}
	// Specifies an auto scaling policy for write capacity.
	WriteProvisionedThroughputSettings() interface{}
	SetWriteProvisionedThroughputSettings(val interface{})
	// Syntactic sugar for `addOverride(path, undefined)`.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	AddDependency(target awscdk.CfnResource)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	// Deprecated: use addDependency.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//   "GlobalSecondaryIndexes": [
	//     {
	//       "Projection": {
	//         "NonKeyAttributes": [ "myattribute" ]
	//         ...
	//       }
	//       ...
	//     },
	//     {
	//       "ProjectionType": "INCLUDE"
	//       ...
	//     },
	//   ]
	//   ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
	// cases, a snapshot can be taken of the resource prior to deletion
	// (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
	// can be found in the following link:.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options
	//
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Retrieves an array of resources this resource depends on.
	//
	// This assembles dependencies on resources across stacks (including nested stacks)
	// automatically.
	ObtainDependencies() *[]interface{}
	// Get a shallow copy of dependencies between this resource and other resources in the same stack.
	ObtainResourceDependencies() *[]awscdk.CfnResource
	// Overrides the auto-generated logical ID with a specific ID.
	OverrideLogicalId(newLogicalId *string)
	// Indicates that this resource no longer depends on another resource.
	//
	// This can be used for resources across stacks (including nested stacks)
	// and the dependency will automatically be removed from the relevant scope.
	RemoveDependency(target awscdk.CfnResource)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Replaces one dependency with another.
	ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource)
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	ShouldSynthesize() *bool
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	ToString() *string
	ValidateProperties(_properties interface{})
}

The `AWS::DynamoDB::GlobalTable` resource enables you to create and manage a Version 2019.11.21 global table. This resource cannot be used to create or manage a Version 2017.11.29 global table. For more information, see [Global tables](https://docs.aws.amazon.com//amazondynamodb/latest/developerguide/GlobalTables.html) .

> You cannot convert a resource of type `AWS::DynamoDB::Table` into a resource of type `AWS::DynamoDB::GlobalTable` by changing its type in your template. *Doing so might result in the deletion of your DynamoDB table.* > > You can instead use the GlobalTable resource to create a new table in a single Region. This will be billed the same as a single Region table. If you later update the stack to add other Regions then Global Tables pricing will apply.

You should be aware of the following behaviors when working with DynamoDB global tables.

- The IAM Principal executing the stack operation must have the permissions listed below in all regions where you plan to have a global table replica. The IAM Principal's permissions should not have restrictions based on IP source address. Some global tables operations (for example, adding a replica) are asynchronous, and require that the IAM Principal is valid until they complete. You should not delete the Principal (user or IAM role) until CloudFormation has finished updating your stack.

- `dynamodb:CreateTable` - `dynamodb:UpdateTable` - `dynamodb:DeleteTable` - `dynamodb:DescribeContinuousBackups` - `dynamodb:DescribeContributorInsights` - `dynamodb:DescribeTable` - `dynamodb:DescribeTableReplicaAutoScaling` - `dynamodb:DescribeTimeToLive` - `dynamodb:ListTables` - `dynamodb:UpdateTimeToLive` - `dynamodb:UpdateContributorInsights` - `dynamodb:UpdateContinuousBackups` - `dynamodb:ListTagsOfResource` - `dynamodb:TagResource` - `dynamodb:UntagResource` - `dynamodb:BatchWriteItem` - `dynamodb:CreateTableReplica` - `dynamodb:DeleteItem` - `dynamodb:DeleteTableReplica` - `dynamodb:DisableKinesisStreamingDestination` - `dynamodb:EnableKinesisStreamingDestination` - `dynamodb:GetItem` - `dynamodb:PutItem` - `dynamodb:Query` - `dynamodb:Scan` - `dynamodb:UpdateItem` - `dynamodb:DescribeTableReplicaAutoScaling` - `dynamodb:UpdateTableReplicaAutoScaling` - `iam:CreateServiceLinkedRole` - `kms:CreateGrant` - `kms:DescribeKey` - `application-autoscaling:DeleteScalingPolicy` - `application-autoscaling:DeleteScheduledAction` - `application-autoscaling:DeregisterScalableTarget` - `application-autoscaling:DescribeScalingPolicies` - `application-autoscaling:DescribeScalableTargets` - `application-autoscaling:PutScalingPolicy` - `application-autoscaling:PutScheduledAction` - `application-autoscaling:RegisterScalableTarget` - When using provisioned billing mode, CloudFormation will create an auto scaling policy on each of your replicas to control their write capacities. You must configure this policy using the `WriteProvisionedThroughputSettings` property. CloudFormation will ensure that all replicas have the same write capacity auto scaling property. You cannot directly specify a value for write capacity for a global table. - If your table uses provisioned capacity, you must configure auto scaling directly in the `AWS::DynamoDB::GlobalTable` resource. You should not configure additional auto scaling policies on any of the table replicas or global secondary indexes, either via API or via `AWS::ApplicationAutoScaling::ScalableTarget` or `AWS::ApplicationAutoScaling::ScalingPolicy` . Doing so might result in unexpected behavior and is unsupported. - In AWS CloudFormation , each global table is controlled by a single stack, in a single region, regardless of the number of replicas. When you deploy your template, CloudFormation will create/update all replicas as part of a single stack operation. You should not deploy the same `AWS::DynamoDB::GlobalTable` resource in multiple regions. Doing so will result in errors, and is unsupported. If you deploy your application template in multiple regions, you can use conditions to only create the resource in a single region. Alternatively, you can choose to define your `AWS::DynamoDB::GlobalTable` resources in a stack separate from your application stack, and make sure it is only deployed to a single region.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnGlobalTable := awscdk.Aws_dynamodb.NewCfnGlobalTable(this, jsii.String("MyCfnGlobalTable"), &CfnGlobalTableProps{
	AttributeDefinitions: []interface{}{
		&AttributeDefinitionProperty{
			AttributeName: jsii.String("attributeName"),
			AttributeType: jsii.String("attributeType"),
		},
	},
	KeySchema: []interface{}{
		&KeySchemaProperty{
			AttributeName: jsii.String("attributeName"),
			KeyType: jsii.String("keyType"),
		},
	},
	Replicas: []interface{}{
		&ReplicaSpecificationProperty{
			Region: jsii.String("region"),

			// the properties below are optional
			ContributorInsightsSpecification: &ContributorInsightsSpecificationProperty{
				Enabled: jsii.Boolean(false),
			},
			DeletionProtectionEnabled: jsii.Boolean(false),
			GlobalSecondaryIndexes: []interface{}{
				&ReplicaGlobalSecondaryIndexSpecificationProperty{
					IndexName: jsii.String("indexName"),

					// the properties below are optional
					ContributorInsightsSpecification: &ContributorInsightsSpecificationProperty{
						Enabled: jsii.Boolean(false),
					},
					ReadProvisionedThroughputSettings: &ReadProvisionedThroughputSettingsProperty{
						ReadCapacityAutoScalingSettings: &CapacityAutoScalingSettingsProperty{
							MaxCapacity: jsii.Number(123),
							MinCapacity: jsii.Number(123),
							TargetTrackingScalingPolicyConfiguration: &TargetTrackingScalingPolicyConfigurationProperty{
								TargetValue: jsii.Number(123),

								// the properties below are optional
								DisableScaleIn: jsii.Boolean(false),
								ScaleInCooldown: jsii.Number(123),
								ScaleOutCooldown: jsii.Number(123),
							},

							// the properties below are optional
							SeedCapacity: jsii.Number(123),
						},
						ReadCapacityUnits: jsii.Number(123),
					},
				},
			},
			KinesisStreamSpecification: &KinesisStreamSpecificationProperty{
				StreamArn: jsii.String("streamArn"),

				// the properties below are optional
				ApproximateCreationDateTimePrecision: jsii.String("approximateCreationDateTimePrecision"),
			},
			PointInTimeRecoverySpecification: &PointInTimeRecoverySpecificationProperty{
				PointInTimeRecoveryEnabled: jsii.Boolean(false),
			},
			ReadProvisionedThroughputSettings: &ReadProvisionedThroughputSettingsProperty{
				ReadCapacityAutoScalingSettings: &CapacityAutoScalingSettingsProperty{
					MaxCapacity: jsii.Number(123),
					MinCapacity: jsii.Number(123),
					TargetTrackingScalingPolicyConfiguration: &TargetTrackingScalingPolicyConfigurationProperty{
						TargetValue: jsii.Number(123),

						// the properties below are optional
						DisableScaleIn: jsii.Boolean(false),
						ScaleInCooldown: jsii.Number(123),
						ScaleOutCooldown: jsii.Number(123),
					},

					// the properties below are optional
					SeedCapacity: jsii.Number(123),
				},
				ReadCapacityUnits: jsii.Number(123),
			},
			SseSpecification: &ReplicaSSESpecificationProperty{
				KmsMasterKeyId: jsii.String("kmsMasterKeyId"),
			},
			TableClass: jsii.String("tableClass"),
			Tags: []cfnTag{
				&cfnTag{
					Key: jsii.String("key"),
					Value: jsii.String("value"),
				},
			},
		},
	},

	// the properties below are optional
	BillingMode: jsii.String("billingMode"),
	GlobalSecondaryIndexes: []interface{}{
		&GlobalSecondaryIndexProperty{
			IndexName: jsii.String("indexName"),
			KeySchema: []interface{}{
				&KeySchemaProperty{
					AttributeName: jsii.String("attributeName"),
					KeyType: jsii.String("keyType"),
				},
			},
			Projection: &ProjectionProperty{
				NonKeyAttributes: []*string{
					jsii.String("nonKeyAttributes"),
				},
				ProjectionType: jsii.String("projectionType"),
			},

			// the properties below are optional
			WriteProvisionedThroughputSettings: &WriteProvisionedThroughputSettingsProperty{
				WriteCapacityAutoScalingSettings: &CapacityAutoScalingSettingsProperty{
					MaxCapacity: jsii.Number(123),
					MinCapacity: jsii.Number(123),
					TargetTrackingScalingPolicyConfiguration: &TargetTrackingScalingPolicyConfigurationProperty{
						TargetValue: jsii.Number(123),

						// the properties below are optional
						DisableScaleIn: jsii.Boolean(false),
						ScaleInCooldown: jsii.Number(123),
						ScaleOutCooldown: jsii.Number(123),
					},

					// the properties below are optional
					SeedCapacity: jsii.Number(123),
				},
			},
		},
	},
	LocalSecondaryIndexes: []interface{}{
		&LocalSecondaryIndexProperty{
			IndexName: jsii.String("indexName"),
			KeySchema: []interface{}{
				&KeySchemaProperty{
					AttributeName: jsii.String("attributeName"),
					KeyType: jsii.String("keyType"),
				},
			},
			Projection: &ProjectionProperty{
				NonKeyAttributes: []*string{
					jsii.String("nonKeyAttributes"),
				},
				ProjectionType: jsii.String("projectionType"),
			},
		},
	},
	SseSpecification: &SSESpecificationProperty{
		SseEnabled: jsii.Boolean(false),

		// the properties below are optional
		SseType: jsii.String("sseType"),
	},
	StreamSpecification: &StreamSpecificationProperty{
		StreamViewType: jsii.String("streamViewType"),
	},
	TableName: jsii.String("tableName"),
	TimeToLiveSpecification: &TimeToLiveSpecificationProperty{
		Enabled: jsii.Boolean(false),

		// the properties below are optional
		AttributeName: jsii.String("attributeName"),
	},
	WriteProvisionedThroughputSettings: &WriteProvisionedThroughputSettingsProperty{
		WriteCapacityAutoScalingSettings: &CapacityAutoScalingSettingsProperty{
			MaxCapacity: jsii.Number(123),
			MinCapacity: jsii.Number(123),
			TargetTrackingScalingPolicyConfiguration: &TargetTrackingScalingPolicyConfigurationProperty{
				TargetValue: jsii.Number(123),

				// the properties below are optional
				DisableScaleIn: jsii.Boolean(false),
				ScaleInCooldown: jsii.Number(123),
				ScaleOutCooldown: jsii.Number(123),
			},

			// the properties below are optional
			SeedCapacity: jsii.Number(123),
		},
	},
})

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-globaltable.html

func NewCfnGlobalTable

func NewCfnGlobalTable(scope constructs.Construct, id *string, props *CfnGlobalTableProps) CfnGlobalTable

type CfnGlobalTableProps

type CfnGlobalTableProps struct {
	// A list of attributes that describe the key schema for the global table and indexes.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-globaltable.html#cfn-dynamodb-globaltable-attributedefinitions
	//
	AttributeDefinitions interface{} `field:"required" json:"attributeDefinitions" yaml:"attributeDefinitions"`
	// Specifies the attributes that make up the primary key for the table.
	//
	// The attributes in the `KeySchema` property must also be defined in the `AttributeDefinitions` property.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-globaltable.html#cfn-dynamodb-globaltable-keyschema
	//
	KeySchema interface{} `field:"required" json:"keySchema" yaml:"keySchema"`
	// Specifies the list of replicas for your global table.
	//
	// The list must contain at least one element, the region where the stack defining the global table is deployed. For example, if you define your table in a stack deployed to us-east-1, you must have an entry in `Replicas` with the region us-east-1. You cannot remove the replica in the stack region.
	//
	// > Adding a replica might take a few minutes for an empty table, or up to several hours for large tables. If you want to add or remove a replica, we recommend submitting an `UpdateStack` operation containing only that change.
	// >
	// > If you add or delete a replica during an update, we recommend that you don't update any other resources. If your stack fails to update and is rolled back while adding a new replica, you might need to manually delete the replica.
	//
	// You can create a new global table with as many replicas as needed. You can add or remove replicas after table creation, but you can only add or remove a single replica in each update.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-globaltable.html#cfn-dynamodb-globaltable-replicas
	//
	Replicas interface{} `field:"required" json:"replicas" yaml:"replicas"`
	// Specifies how you are charged for read and write throughput and how you manage capacity. Valid values are:.
	//
	// - `PAY_PER_REQUEST`
	// - `PROVISIONED`
	//
	// All replicas in your global table will have the same billing mode. If you use `PROVISIONED` billing mode, you must provide an auto scaling configuration via the `WriteProvisionedThroughputSettings` property. The default value of this property is `PROVISIONED` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-globaltable.html#cfn-dynamodb-globaltable-billingmode
	//
	BillingMode *string `field:"optional" json:"billingMode" yaml:"billingMode"`
	// Global secondary indexes to be created on the global table.
	//
	// You can create up to 20 global secondary indexes. Each replica in your global table will have the same global secondary index settings. You can only create or delete one global secondary index in a single stack operation.
	//
	// Since the backfilling of an index could take a long time, CloudFormation does not wait for the index to become active. If a stack operation rolls back, CloudFormation might not delete an index that has been added. In that case, you will need to delete the index manually.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-globaltable.html#cfn-dynamodb-globaltable-globalsecondaryindexes
	//
	GlobalSecondaryIndexes interface{} `field:"optional" json:"globalSecondaryIndexes" yaml:"globalSecondaryIndexes"`
	// Local secondary indexes to be created on the table.
	//
	// You can create up to five local secondary indexes. Each index is scoped to a given hash key value. The size of each hash key can be up to 10 gigabytes. Each replica in your global table will have the same local secondary index settings.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-globaltable.html#cfn-dynamodb-globaltable-localsecondaryindexes
	//
	LocalSecondaryIndexes interface{} `field:"optional" json:"localSecondaryIndexes" yaml:"localSecondaryIndexes"`
	// Specifies the settings to enable server-side encryption.
	//
	// These settings will be applied to all replicas. If you plan to use customer-managed KMS keys, you must provide a key for each replica using the `ReplicaSpecification.ReplicaSSESpecification` property.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-globaltable.html#cfn-dynamodb-globaltable-ssespecification
	//
	SseSpecification interface{} `field:"optional" json:"sseSpecification" yaml:"sseSpecification"`
	// Specifies the streams settings on your global table.
	//
	// You must provide a value for this property if your global table contains more than one replica. You can only change the streams settings if your global table has only one replica.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-globaltable.html#cfn-dynamodb-globaltable-streamspecification
	//
	StreamSpecification interface{} `field:"optional" json:"streamSpecification" yaml:"streamSpecification"`
	// A name for the global table.
	//
	// If you don't specify a name, AWS CloudFormation generates a unique ID and uses that ID as the table name. For more information, see [Name type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html) .
	//
	// > If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-globaltable.html#cfn-dynamodb-globaltable-tablename
	//
	TableName *string `field:"optional" json:"tableName" yaml:"tableName"`
	// Specifies the time to live (TTL) settings for the table.
	//
	// This setting will be applied to all replicas.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-globaltable.html#cfn-dynamodb-globaltable-timetolivespecification
	//
	TimeToLiveSpecification interface{} `field:"optional" json:"timeToLiveSpecification" yaml:"timeToLiveSpecification"`
	// Specifies an auto scaling policy for write capacity.
	//
	// This policy will be applied to all replicas. This setting must be specified if `BillingMode` is set to `PROVISIONED` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-globaltable.html#cfn-dynamodb-globaltable-writeprovisionedthroughputsettings
	//
	WriteProvisionedThroughputSettings interface{} `field:"optional" json:"writeProvisionedThroughputSettings" yaml:"writeProvisionedThroughputSettings"`
}

Properties for defining a `CfnGlobalTable`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnGlobalTableProps := &CfnGlobalTableProps{
	AttributeDefinitions: []interface{}{
		&AttributeDefinitionProperty{
			AttributeName: jsii.String("attributeName"),
			AttributeType: jsii.String("attributeType"),
		},
	},
	KeySchema: []interface{}{
		&KeySchemaProperty{
			AttributeName: jsii.String("attributeName"),
			KeyType: jsii.String("keyType"),
		},
	},
	Replicas: []interface{}{
		&ReplicaSpecificationProperty{
			Region: jsii.String("region"),

			// the properties below are optional
			ContributorInsightsSpecification: &ContributorInsightsSpecificationProperty{
				Enabled: jsii.Boolean(false),
			},
			DeletionProtectionEnabled: jsii.Boolean(false),
			GlobalSecondaryIndexes: []interface{}{
				&ReplicaGlobalSecondaryIndexSpecificationProperty{
					IndexName: jsii.String("indexName"),

					// the properties below are optional
					ContributorInsightsSpecification: &ContributorInsightsSpecificationProperty{
						Enabled: jsii.Boolean(false),
					},
					ReadProvisionedThroughputSettings: &ReadProvisionedThroughputSettingsProperty{
						ReadCapacityAutoScalingSettings: &CapacityAutoScalingSettingsProperty{
							MaxCapacity: jsii.Number(123),
							MinCapacity: jsii.Number(123),
							TargetTrackingScalingPolicyConfiguration: &TargetTrackingScalingPolicyConfigurationProperty{
								TargetValue: jsii.Number(123),

								// the properties below are optional
								DisableScaleIn: jsii.Boolean(false),
								ScaleInCooldown: jsii.Number(123),
								ScaleOutCooldown: jsii.Number(123),
							},

							// the properties below are optional
							SeedCapacity: jsii.Number(123),
						},
						ReadCapacityUnits: jsii.Number(123),
					},
				},
			},
			KinesisStreamSpecification: &KinesisStreamSpecificationProperty{
				StreamArn: jsii.String("streamArn"),

				// the properties below are optional
				ApproximateCreationDateTimePrecision: jsii.String("approximateCreationDateTimePrecision"),
			},
			PointInTimeRecoverySpecification: &PointInTimeRecoverySpecificationProperty{
				PointInTimeRecoveryEnabled: jsii.Boolean(false),
			},
			ReadProvisionedThroughputSettings: &ReadProvisionedThroughputSettingsProperty{
				ReadCapacityAutoScalingSettings: &CapacityAutoScalingSettingsProperty{
					MaxCapacity: jsii.Number(123),
					MinCapacity: jsii.Number(123),
					TargetTrackingScalingPolicyConfiguration: &TargetTrackingScalingPolicyConfigurationProperty{
						TargetValue: jsii.Number(123),

						// the properties below are optional
						DisableScaleIn: jsii.Boolean(false),
						ScaleInCooldown: jsii.Number(123),
						ScaleOutCooldown: jsii.Number(123),
					},

					// the properties below are optional
					SeedCapacity: jsii.Number(123),
				},
				ReadCapacityUnits: jsii.Number(123),
			},
			SseSpecification: &ReplicaSSESpecificationProperty{
				KmsMasterKeyId: jsii.String("kmsMasterKeyId"),
			},
			TableClass: jsii.String("tableClass"),
			Tags: []cfnTag{
				&cfnTag{
					Key: jsii.String("key"),
					Value: jsii.String("value"),
				},
			},
		},
	},

	// the properties below are optional
	BillingMode: jsii.String("billingMode"),
	GlobalSecondaryIndexes: []interface{}{
		&GlobalSecondaryIndexProperty{
			IndexName: jsii.String("indexName"),
			KeySchema: []interface{}{
				&KeySchemaProperty{
					AttributeName: jsii.String("attributeName"),
					KeyType: jsii.String("keyType"),
				},
			},
			Projection: &ProjectionProperty{
				NonKeyAttributes: []*string{
					jsii.String("nonKeyAttributes"),
				},
				ProjectionType: jsii.String("projectionType"),
			},

			// the properties below are optional
			WriteProvisionedThroughputSettings: &WriteProvisionedThroughputSettingsProperty{
				WriteCapacityAutoScalingSettings: &CapacityAutoScalingSettingsProperty{
					MaxCapacity: jsii.Number(123),
					MinCapacity: jsii.Number(123),
					TargetTrackingScalingPolicyConfiguration: &TargetTrackingScalingPolicyConfigurationProperty{
						TargetValue: jsii.Number(123),

						// the properties below are optional
						DisableScaleIn: jsii.Boolean(false),
						ScaleInCooldown: jsii.Number(123),
						ScaleOutCooldown: jsii.Number(123),
					},

					// the properties below are optional
					SeedCapacity: jsii.Number(123),
				},
			},
		},
	},
	LocalSecondaryIndexes: []interface{}{
		&LocalSecondaryIndexProperty{
			IndexName: jsii.String("indexName"),
			KeySchema: []interface{}{
				&KeySchemaProperty{
					AttributeName: jsii.String("attributeName"),
					KeyType: jsii.String("keyType"),
				},
			},
			Projection: &ProjectionProperty{
				NonKeyAttributes: []*string{
					jsii.String("nonKeyAttributes"),
				},
				ProjectionType: jsii.String("projectionType"),
			},
		},
	},
	SseSpecification: &SSESpecificationProperty{
		SseEnabled: jsii.Boolean(false),

		// the properties below are optional
		SseType: jsii.String("sseType"),
	},
	StreamSpecification: &StreamSpecificationProperty{
		StreamViewType: jsii.String("streamViewType"),
	},
	TableName: jsii.String("tableName"),
	TimeToLiveSpecification: &TimeToLiveSpecificationProperty{
		Enabled: jsii.Boolean(false),

		// the properties below are optional
		AttributeName: jsii.String("attributeName"),
	},
	WriteProvisionedThroughputSettings: &WriteProvisionedThroughputSettingsProperty{
		WriteCapacityAutoScalingSettings: &CapacityAutoScalingSettingsProperty{
			MaxCapacity: jsii.Number(123),
			MinCapacity: jsii.Number(123),
			TargetTrackingScalingPolicyConfiguration: &TargetTrackingScalingPolicyConfigurationProperty{
				TargetValue: jsii.Number(123),

				// the properties below are optional
				DisableScaleIn: jsii.Boolean(false),
				ScaleInCooldown: jsii.Number(123),
				ScaleOutCooldown: jsii.Number(123),
			},

			// the properties below are optional
			SeedCapacity: jsii.Number(123),
		},
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-globaltable.html

type CfnGlobalTable_AttributeDefinitionProperty

type CfnGlobalTable_AttributeDefinitionProperty struct {
	// A name for the attribute.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-attributedefinition.html#cfn-dynamodb-globaltable-attributedefinition-attributename
	//
	AttributeName *string `field:"required" json:"attributeName" yaml:"attributeName"`
	// The data type for the attribute, where:.
	//
	// - `S` - the attribute is of type String
	// - `N` - the attribute is of type Number
	// - `B` - the attribute is of type Binary.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-attributedefinition.html#cfn-dynamodb-globaltable-attributedefinition-attributetype
	//
	AttributeType *string `field:"required" json:"attributeType" yaml:"attributeType"`
}

Represents an attribute for describing the schema for the table and indexes.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

attributeDefinitionProperty := &AttributeDefinitionProperty{
	AttributeName: jsii.String("attributeName"),
	AttributeType: jsii.String("attributeType"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-attributedefinition.html

type CfnGlobalTable_CapacityAutoScalingSettingsProperty

type CfnGlobalTable_CapacityAutoScalingSettingsProperty struct {
	// The maximum provisioned capacity units for the global table.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-capacityautoscalingsettings.html#cfn-dynamodb-globaltable-capacityautoscalingsettings-maxcapacity
	//
	MaxCapacity *float64 `field:"required" json:"maxCapacity" yaml:"maxCapacity"`
	// The minimum provisioned capacity units for the global table.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-capacityautoscalingsettings.html#cfn-dynamodb-globaltable-capacityautoscalingsettings-mincapacity
	//
	MinCapacity *float64 `field:"required" json:"minCapacity" yaml:"minCapacity"`
	// Defines a target tracking scaling policy.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-capacityautoscalingsettings.html#cfn-dynamodb-globaltable-capacityautoscalingsettings-targettrackingscalingpolicyconfiguration
	//
	TargetTrackingScalingPolicyConfiguration interface{} `field:"required" json:"targetTrackingScalingPolicyConfiguration" yaml:"targetTrackingScalingPolicyConfiguration"`
	// When switching billing mode from `PAY_PER_REQUEST` to `PROVISIONED` , DynamoDB requires you to specify read and write capacity unit values for the table and for each global secondary index.
	//
	// These values will be applied to all replicas. The table will use these provisioned values until CloudFormation creates the autoscaling policies you configured in your template. CloudFormation cannot determine what capacity the table and its global secondary indexes will require in this time period, since they are application-dependent.
	//
	// If you want to switch a table's billing mode from `PAY_PER_REQUEST` to `PROVISIONED` , you must specify a value for this property for each autoscaled resource. If you specify different values for the same resource in different regions, CloudFormation will use the highest value found in either the `SeedCapacity` or `ReadCapacityUnits` properties. For example, if your global secondary index `myGSI` has a `SeedCapacity` of 10 in us-east-1 and a fixed `ReadCapacityUnits` of 20 in eu-west-1, CloudFormation will initially set the read capacity for `myGSI` to 20. Note that if you disable `ScaleIn` for `myGSI` in us-east-1, its read capacity units might not be set back to 10.
	//
	// You must also specify a value for `SeedCapacity` when you plan to switch a table's billing mode from `PROVISIONED` to `PAY_PER_REQUEST` , because CloudFormation might need to roll back the operation (reverting the billing mode to `PROVISIONED` ) and this cannot succeed without specifying a value for `SeedCapacity` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-capacityautoscalingsettings.html#cfn-dynamodb-globaltable-capacityautoscalingsettings-seedcapacity
	//
	SeedCapacity *float64 `field:"optional" json:"seedCapacity" yaml:"seedCapacity"`
}

Configures a scalable target and an autoscaling policy for a table or global secondary index's read or write capacity.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

capacityAutoScalingSettingsProperty := &CapacityAutoScalingSettingsProperty{
	MaxCapacity: jsii.Number(123),
	MinCapacity: jsii.Number(123),
	TargetTrackingScalingPolicyConfiguration: &TargetTrackingScalingPolicyConfigurationProperty{
		TargetValue: jsii.Number(123),

		// the properties below are optional
		DisableScaleIn: jsii.Boolean(false),
		ScaleInCooldown: jsii.Number(123),
		ScaleOutCooldown: jsii.Number(123),
	},

	// the properties below are optional
	SeedCapacity: jsii.Number(123),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-capacityautoscalingsettings.html

type CfnGlobalTable_ContributorInsightsSpecificationProperty

type CfnGlobalTable_ContributorInsightsSpecificationProperty struct {
	// Indicates whether CloudWatch Contributor Insights are to be enabled (true) or disabled (false).
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-contributorinsightsspecification.html#cfn-dynamodb-globaltable-contributorinsightsspecification-enabled
	//
	Enabled interface{} `field:"required" json:"enabled" yaml:"enabled"`
}

Configures contributor insights settings for a replica or one of its indexes.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

contributorInsightsSpecificationProperty := &ContributorInsightsSpecificationProperty{
	Enabled: jsii.Boolean(false),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-contributorinsightsspecification.html

type CfnGlobalTable_GlobalSecondaryIndexProperty

type CfnGlobalTable_GlobalSecondaryIndexProperty struct {
	// The name of the global secondary index.
	//
	// The name must be unique among all other indexes on this table.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-globalsecondaryindex.html#cfn-dynamodb-globaltable-globalsecondaryindex-indexname
	//
	IndexName *string `field:"required" json:"indexName" yaml:"indexName"`
	// The complete key schema for a global secondary index, which consists of one or more pairs of attribute names and key types:  - `HASH` - partition key - `RANGE` - sort key  > The partition key of an item is also known as its *hash attribute* .
	//
	// The term "hash attribute" derives from DynamoDB's usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values.
	// >
	// > The sort key of an item is also known as its *range attribute* . The term "range attribute" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-globalsecondaryindex.html#cfn-dynamodb-globaltable-globalsecondaryindex-keyschema
	//
	KeySchema interface{} `field:"required" json:"keySchema" yaml:"keySchema"`
	// Represents attributes that are copied (projected) from the table into the global secondary index.
	//
	// These are in addition to the primary key attributes and index key attributes, which are automatically projected.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-globalsecondaryindex.html#cfn-dynamodb-globaltable-globalsecondaryindex-projection
	//
	Projection interface{} `field:"required" json:"projection" yaml:"projection"`
	// Defines write capacity settings for the global secondary index.
	//
	// You must specify a value for this property if the table's `BillingMode` is `PROVISIONED` . All replicas will have the same write capacity settings for this global secondary index.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-globalsecondaryindex.html#cfn-dynamodb-globaltable-globalsecondaryindex-writeprovisionedthroughputsettings
	//
	WriteProvisionedThroughputSettings interface{} `field:"optional" json:"writeProvisionedThroughputSettings" yaml:"writeProvisionedThroughputSettings"`
}

Allows you to specify a global secondary index for the global table.

The index will be defined on all replicas.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

globalSecondaryIndexProperty := &GlobalSecondaryIndexProperty{
	IndexName: jsii.String("indexName"),
	KeySchema: []interface{}{
		&KeySchemaProperty{
			AttributeName: jsii.String("attributeName"),
			KeyType: jsii.String("keyType"),
		},
	},
	Projection: &ProjectionProperty{
		NonKeyAttributes: []*string{
			jsii.String("nonKeyAttributes"),
		},
		ProjectionType: jsii.String("projectionType"),
	},

	// the properties below are optional
	WriteProvisionedThroughputSettings: &WriteProvisionedThroughputSettingsProperty{
		WriteCapacityAutoScalingSettings: &CapacityAutoScalingSettingsProperty{
			MaxCapacity: jsii.Number(123),
			MinCapacity: jsii.Number(123),
			TargetTrackingScalingPolicyConfiguration: &TargetTrackingScalingPolicyConfigurationProperty{
				TargetValue: jsii.Number(123),

				// the properties below are optional
				DisableScaleIn: jsii.Boolean(false),
				ScaleInCooldown: jsii.Number(123),
				ScaleOutCooldown: jsii.Number(123),
			},

			// the properties below are optional
			SeedCapacity: jsii.Number(123),
		},
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-globalsecondaryindex.html

type CfnGlobalTable_KeySchemaProperty

type CfnGlobalTable_KeySchemaProperty struct {
	// The name of a key attribute.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-keyschema.html#cfn-dynamodb-globaltable-keyschema-attributename
	//
	AttributeName *string `field:"required" json:"attributeName" yaml:"attributeName"`
	// The role that this key attribute will assume:.
	//
	// - `HASH` - partition key
	// - `RANGE` - sort key
	//
	// > The partition key of an item is also known as its *hash attribute* . The term "hash attribute" derives from DynamoDB's usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values.
	// >
	// > The sort key of an item is also known as its *range attribute* . The term "range attribute" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-keyschema.html#cfn-dynamodb-globaltable-keyschema-keytype
	//
	KeyType *string `field:"required" json:"keyType" yaml:"keyType"`
}

Represents *a single element* of a key schema.

A key schema specifies the attributes that make up the primary key of a table, or the key attributes of an index.

A `KeySchemaElement` represents exactly one attribute of the primary key. For example, a simple primary key would be represented by one `KeySchemaElement` (for the partition key). A composite primary key would require one `KeySchemaElement` for the partition key, and another `KeySchemaElement` for the sort key.

A `KeySchemaElement` must be a scalar, top-level attribute (not a nested attribute). The data type must be one of String, Number, or Binary. The attribute cannot be nested within a List or a Map.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

keySchemaProperty := &KeySchemaProperty{
	AttributeName: jsii.String("attributeName"),
	KeyType: jsii.String("keyType"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-keyschema.html

type CfnGlobalTable_KinesisStreamSpecificationProperty added in v2.70.0

type CfnGlobalTable_KinesisStreamSpecificationProperty struct {
	// The ARN for a specific Kinesis data stream.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-kinesisstreamspecification.html#cfn-dynamodb-globaltable-kinesisstreamspecification-streamarn
	//
	StreamArn *string `field:"required" json:"streamArn" yaml:"streamArn"`
	// The precision for the time and date that the stream was created.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-kinesisstreamspecification.html#cfn-dynamodb-globaltable-kinesisstreamspecification-approximatecreationdatetimeprecision
	//
	ApproximateCreationDateTimePrecision *string `field:"optional" json:"approximateCreationDateTimePrecision" yaml:"approximateCreationDateTimePrecision"`
}

The Kinesis Data Streams configuration for the specified global table replica.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

kinesisStreamSpecificationProperty := &KinesisStreamSpecificationProperty{
	StreamArn: jsii.String("streamArn"),

	// the properties below are optional
	ApproximateCreationDateTimePrecision: jsii.String("approximateCreationDateTimePrecision"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-kinesisstreamspecification.html

type CfnGlobalTable_LocalSecondaryIndexProperty

type CfnGlobalTable_LocalSecondaryIndexProperty struct {
	// The name of the local secondary index.
	//
	// The name must be unique among all other indexes on this table.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-localsecondaryindex.html#cfn-dynamodb-globaltable-localsecondaryindex-indexname
	//
	IndexName *string `field:"required" json:"indexName" yaml:"indexName"`
	// The complete key schema for the local secondary index, consisting of one or more pairs of attribute names and key types:  - `HASH` - partition key - `RANGE` - sort key  > The partition key of an item is also known as its *hash attribute* .
	//
	// The term "hash attribute" derives from DynamoDB's usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values.
	// >
	// > The sort key of an item is also known as its *range attribute* . The term "range attribute" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-localsecondaryindex.html#cfn-dynamodb-globaltable-localsecondaryindex-keyschema
	//
	KeySchema interface{} `field:"required" json:"keySchema" yaml:"keySchema"`
	// Represents attributes that are copied (projected) from the table into the local secondary index.
	//
	// These are in addition to the primary key attributes and index key attributes, which are automatically projected.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-localsecondaryindex.html#cfn-dynamodb-globaltable-localsecondaryindex-projection
	//
	Projection interface{} `field:"required" json:"projection" yaml:"projection"`
}

Represents the properties of a local secondary index.

A local secondary index can only be created when its parent table is created.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

localSecondaryIndexProperty := &LocalSecondaryIndexProperty{
	IndexName: jsii.String("indexName"),
	KeySchema: []interface{}{
		&KeySchemaProperty{
			AttributeName: jsii.String("attributeName"),
			KeyType: jsii.String("keyType"),
		},
	},
	Projection: &ProjectionProperty{
		NonKeyAttributes: []*string{
			jsii.String("nonKeyAttributes"),
		},
		ProjectionType: jsii.String("projectionType"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-localsecondaryindex.html

type CfnGlobalTable_PointInTimeRecoverySpecificationProperty

type CfnGlobalTable_PointInTimeRecoverySpecificationProperty struct {
	// Indicates whether point in time recovery is enabled (true) or disabled (false) on the table.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-pointintimerecoveryspecification.html#cfn-dynamodb-globaltable-pointintimerecoveryspecification-pointintimerecoveryenabled
	//
	PointInTimeRecoveryEnabled interface{} `field:"optional" json:"pointInTimeRecoveryEnabled" yaml:"pointInTimeRecoveryEnabled"`
}

Represents the settings used to enable point in time recovery.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

pointInTimeRecoverySpecificationProperty := &PointInTimeRecoverySpecificationProperty{
	PointInTimeRecoveryEnabled: jsii.Boolean(false),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-pointintimerecoveryspecification.html

type CfnGlobalTable_ProjectionProperty

type CfnGlobalTable_ProjectionProperty struct {
	// Represents the non-key attribute names which will be projected into the index.
	//
	// For local secondary indexes, the total count of `NonKeyAttributes` summed across all of the local secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-projection.html#cfn-dynamodb-globaltable-projection-nonkeyattributes
	//
	NonKeyAttributes *[]*string `field:"optional" json:"nonKeyAttributes" yaml:"nonKeyAttributes"`
	// The set of attributes that are projected into the index:.
	//
	// - `KEYS_ONLY` - Only the index and primary keys are projected into the index.
	// - `INCLUDE` - In addition to the attributes described in `KEYS_ONLY` , the secondary index will include other non-key attributes that you specify.
	// - `ALL` - All of the table attributes are projected into the index.
	//
	// When using the DynamoDB console, `ALL` is selected by default.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-projection.html#cfn-dynamodb-globaltable-projection-projectiontype
	//
	ProjectionType *string `field:"optional" json:"projectionType" yaml:"projectionType"`
}

Represents attributes that are copied (projected) from the table into an index.

These are in addition to the primary key attributes and index key attributes, which are automatically projected.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

projectionProperty := &ProjectionProperty{
	NonKeyAttributes: []*string{
		jsii.String("nonKeyAttributes"),
	},
	ProjectionType: jsii.String("projectionType"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-projection.html

type CfnGlobalTable_ReadProvisionedThroughputSettingsProperty

type CfnGlobalTable_ReadProvisionedThroughputSettingsProperty struct {
	// Specifies auto scaling settings for the replica table or global secondary index.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-readprovisionedthroughputsettings.html#cfn-dynamodb-globaltable-readprovisionedthroughputsettings-readcapacityautoscalingsettings
	//
	ReadCapacityAutoScalingSettings interface{} `field:"optional" json:"readCapacityAutoScalingSettings" yaml:"readCapacityAutoScalingSettings"`
	// Specifies a fixed read capacity for the replica table or global secondary index.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-readprovisionedthroughputsettings.html#cfn-dynamodb-globaltable-readprovisionedthroughputsettings-readcapacityunits
	//
	ReadCapacityUnits *float64 `field:"optional" json:"readCapacityUnits" yaml:"readCapacityUnits"`
}

Allows you to specify the read capacity settings for a replica table or a replica global secondary index when the `BillingMode` is set to `PROVISIONED` .

You must specify a value for either `ReadCapacityUnits` or `ReadCapacityAutoScalingSettings` , but not both. You can switch between fixed capacity and auto scaling.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

readProvisionedThroughputSettingsProperty := &ReadProvisionedThroughputSettingsProperty{
	ReadCapacityAutoScalingSettings: &CapacityAutoScalingSettingsProperty{
		MaxCapacity: jsii.Number(123),
		MinCapacity: jsii.Number(123),
		TargetTrackingScalingPolicyConfiguration: &TargetTrackingScalingPolicyConfigurationProperty{
			TargetValue: jsii.Number(123),

			// the properties below are optional
			DisableScaleIn: jsii.Boolean(false),
			ScaleInCooldown: jsii.Number(123),
			ScaleOutCooldown: jsii.Number(123),
		},

		// the properties below are optional
		SeedCapacity: jsii.Number(123),
	},
	ReadCapacityUnits: jsii.Number(123),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-readprovisionedthroughputsettings.html

type CfnGlobalTable_ReplicaGlobalSecondaryIndexSpecificationProperty

type CfnGlobalTable_ReplicaGlobalSecondaryIndexSpecificationProperty struct {
	// The name of the global secondary index.
	//
	// The name must be unique among all other indexes on this table.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-replicaglobalsecondaryindexspecification.html#cfn-dynamodb-globaltable-replicaglobalsecondaryindexspecification-indexname
	//
	IndexName *string `field:"required" json:"indexName" yaml:"indexName"`
	// Updates the status for contributor insights for a specific table or index.
	//
	// CloudWatch Contributor Insights for DynamoDB graphs display the partition key and (if applicable) sort key of frequently accessed items and frequently throttled items in plaintext. If you require the use of AWS Key Management Service (KMS) to encrypt this table’s partition key and sort key data with an AWS managed key or customer managed key, you should not enable CloudWatch Contributor Insights for DynamoDB for this table.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-replicaglobalsecondaryindexspecification.html#cfn-dynamodb-globaltable-replicaglobalsecondaryindexspecification-contributorinsightsspecification
	//
	ContributorInsightsSpecification interface{} `field:"optional" json:"contributorInsightsSpecification" yaml:"contributorInsightsSpecification"`
	// Allows you to specify the read capacity settings for a replica global secondary index when the `BillingMode` is set to `PROVISIONED` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-replicaglobalsecondaryindexspecification.html#cfn-dynamodb-globaltable-replicaglobalsecondaryindexspecification-readprovisionedthroughputsettings
	//
	ReadProvisionedThroughputSettings interface{} `field:"optional" json:"readProvisionedThroughputSettings" yaml:"readProvisionedThroughputSettings"`
}

Represents the properties of a global secondary index that can be set on a per-replica basis.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

replicaGlobalSecondaryIndexSpecificationProperty := &ReplicaGlobalSecondaryIndexSpecificationProperty{
	IndexName: jsii.String("indexName"),

	// the properties below are optional
	ContributorInsightsSpecification: &ContributorInsightsSpecificationProperty{
		Enabled: jsii.Boolean(false),
	},
	ReadProvisionedThroughputSettings: &ReadProvisionedThroughputSettingsProperty{
		ReadCapacityAutoScalingSettings: &CapacityAutoScalingSettingsProperty{
			MaxCapacity: jsii.Number(123),
			MinCapacity: jsii.Number(123),
			TargetTrackingScalingPolicyConfiguration: &TargetTrackingScalingPolicyConfigurationProperty{
				TargetValue: jsii.Number(123),

				// the properties below are optional
				DisableScaleIn: jsii.Boolean(false),
				ScaleInCooldown: jsii.Number(123),
				ScaleOutCooldown: jsii.Number(123),
			},

			// the properties below are optional
			SeedCapacity: jsii.Number(123),
		},
		ReadCapacityUnits: jsii.Number(123),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-replicaglobalsecondaryindexspecification.html

type CfnGlobalTable_ReplicaSSESpecificationProperty

type CfnGlobalTable_ReplicaSSESpecificationProperty struct {
	// The AWS KMS key that should be used for the AWS KMS encryption.
	//
	// To specify a key, use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. Note that you should only provide this parameter if the key is different from the default DynamoDB key `alias/aws/dynamodb` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-replicassespecification.html#cfn-dynamodb-globaltable-replicassespecification-kmsmasterkeyid
	//
	KmsMasterKeyId *string `field:"required" json:"kmsMasterKeyId" yaml:"kmsMasterKeyId"`
}

Allows you to specify a KMS key identifier to be used for server-side encryption.

The key can be specified via ARN, key ID, or alias. The key must be created in the same region as the replica.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

replicaSSESpecificationProperty := &ReplicaSSESpecificationProperty{
	KmsMasterKeyId: jsii.String("kmsMasterKeyId"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-replicassespecification.html

type CfnGlobalTable_ReplicaSpecificationProperty

type CfnGlobalTable_ReplicaSpecificationProperty struct {
	// The region in which this replica exists.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-replicaspecification.html#cfn-dynamodb-globaltable-replicaspecification-region
	//
	Region *string `field:"required" json:"region" yaml:"region"`
	// The settings used to enable or disable CloudWatch Contributor Insights for the specified replica.
	//
	// When not specified, defaults to contributor insights disabled for the replica.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-replicaspecification.html#cfn-dynamodb-globaltable-replicaspecification-contributorinsightsspecification
	//
	ContributorInsightsSpecification interface{} `field:"optional" json:"contributorInsightsSpecification" yaml:"contributorInsightsSpecification"`
	// Determines if a replica is protected from deletion.
	//
	// When enabled, the table cannot be deleted by any user or process. This setting is disabled by default. For more information, see [Using deletion protection](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.Basics.html#WorkingWithTables.Basics.DeletionProtection) in the *Amazon DynamoDB Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-replicaspecification.html#cfn-dynamodb-globaltable-replicaspecification-deletionprotectionenabled
	//
	DeletionProtectionEnabled interface{} `field:"optional" json:"deletionProtectionEnabled" yaml:"deletionProtectionEnabled"`
	// Defines additional settings for the global secondary indexes of this replica.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-replicaspecification.html#cfn-dynamodb-globaltable-replicaspecification-globalsecondaryindexes
	//
	GlobalSecondaryIndexes interface{} `field:"optional" json:"globalSecondaryIndexes" yaml:"globalSecondaryIndexes"`
	// Defines the Kinesis Data Streams configuration for the specified replica.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-replicaspecification.html#cfn-dynamodb-globaltable-replicaspecification-kinesisstreamspecification
	//
	KinesisStreamSpecification interface{} `field:"optional" json:"kinesisStreamSpecification" yaml:"kinesisStreamSpecification"`
	// The settings used to enable point in time recovery.
	//
	// When not specified, defaults to point in time recovery disabled for the replica.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-replicaspecification.html#cfn-dynamodb-globaltable-replicaspecification-pointintimerecoveryspecification
	//
	PointInTimeRecoverySpecification interface{} `field:"optional" json:"pointInTimeRecoverySpecification" yaml:"pointInTimeRecoverySpecification"`
	// Defines read capacity settings for the replica table.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-replicaspecification.html#cfn-dynamodb-globaltable-replicaspecification-readprovisionedthroughputsettings
	//
	ReadProvisionedThroughputSettings interface{} `field:"optional" json:"readProvisionedThroughputSettings" yaml:"readProvisionedThroughputSettings"`
	// Allows you to specify a customer-managed key for the replica.
	//
	// When using customer-managed keys for server-side encryption, this property must have a value in all replicas.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-replicaspecification.html#cfn-dynamodb-globaltable-replicaspecification-ssespecification
	//
	SseSpecification interface{} `field:"optional" json:"sseSpecification" yaml:"sseSpecification"`
	// The table class of the specified table.
	//
	// Valid values are `STANDARD` and `STANDARD_INFREQUENT_ACCESS` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-replicaspecification.html#cfn-dynamodb-globaltable-replicaspecification-tableclass
	//
	TableClass *string `field:"optional" json:"tableClass" yaml:"tableClass"`
	// An array of key-value pairs to apply to this replica.
	//
	// For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html) .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-replicaspecification.html#cfn-dynamodb-globaltable-replicaspecification-tags
	//
	Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"`
}

Defines settings specific to a single replica of a global table.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

replicaSpecificationProperty := &ReplicaSpecificationProperty{
	Region: jsii.String("region"),

	// the properties below are optional
	ContributorInsightsSpecification: &ContributorInsightsSpecificationProperty{
		Enabled: jsii.Boolean(false),
	},
	DeletionProtectionEnabled: jsii.Boolean(false),
	GlobalSecondaryIndexes: []interface{}{
		&ReplicaGlobalSecondaryIndexSpecificationProperty{
			IndexName: jsii.String("indexName"),

			// the properties below are optional
			ContributorInsightsSpecification: &ContributorInsightsSpecificationProperty{
				Enabled: jsii.Boolean(false),
			},
			ReadProvisionedThroughputSettings: &ReadProvisionedThroughputSettingsProperty{
				ReadCapacityAutoScalingSettings: &CapacityAutoScalingSettingsProperty{
					MaxCapacity: jsii.Number(123),
					MinCapacity: jsii.Number(123),
					TargetTrackingScalingPolicyConfiguration: &TargetTrackingScalingPolicyConfigurationProperty{
						TargetValue: jsii.Number(123),

						// the properties below are optional
						DisableScaleIn: jsii.Boolean(false),
						ScaleInCooldown: jsii.Number(123),
						ScaleOutCooldown: jsii.Number(123),
					},

					// the properties below are optional
					SeedCapacity: jsii.Number(123),
				},
				ReadCapacityUnits: jsii.Number(123),
			},
		},
	},
	KinesisStreamSpecification: &KinesisStreamSpecificationProperty{
		StreamArn: jsii.String("streamArn"),

		// the properties below are optional
		ApproximateCreationDateTimePrecision: jsii.String("approximateCreationDateTimePrecision"),
	},
	PointInTimeRecoverySpecification: &PointInTimeRecoverySpecificationProperty{
		PointInTimeRecoveryEnabled: jsii.Boolean(false),
	},
	ReadProvisionedThroughputSettings: &ReadProvisionedThroughputSettingsProperty{
		ReadCapacityAutoScalingSettings: &CapacityAutoScalingSettingsProperty{
			MaxCapacity: jsii.Number(123),
			MinCapacity: jsii.Number(123),
			TargetTrackingScalingPolicyConfiguration: &TargetTrackingScalingPolicyConfigurationProperty{
				TargetValue: jsii.Number(123),

				// the properties below are optional
				DisableScaleIn: jsii.Boolean(false),
				ScaleInCooldown: jsii.Number(123),
				ScaleOutCooldown: jsii.Number(123),
			},

			// the properties below are optional
			SeedCapacity: jsii.Number(123),
		},
		ReadCapacityUnits: jsii.Number(123),
	},
	SseSpecification: &ReplicaSSESpecificationProperty{
		KmsMasterKeyId: jsii.String("kmsMasterKeyId"),
	},
	TableClass: jsii.String("tableClass"),
	Tags: []cfnTag{
		&cfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-replicaspecification.html

type CfnGlobalTable_SSESpecificationProperty

type CfnGlobalTable_SSESpecificationProperty struct {
	// Indicates whether server-side encryption is performed using an AWS managed key or an AWS owned key.
	//
	// If enabled (true), server-side encryption type is set to KMS and an AWS managed key is used ( AWS KMS charges apply). If disabled (false) or not specified,server-side encryption is set to an AWS owned key. If you choose to use KMS encryption, you can also use customer managed KMS keys by specifying them in the `ReplicaSpecification.SSESpecification` object. You cannot mix AWS managed and customer managed KMS keys.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-ssespecification.html#cfn-dynamodb-globaltable-ssespecification-sseenabled
	//
	SseEnabled interface{} `field:"required" json:"sseEnabled" yaml:"sseEnabled"`
	// Server-side encryption type. The only supported value is:.
	//
	// - `KMS` - Server-side encryption that uses AWS Key Management Service . The key is stored in your account and is managed by AWS KMS ( AWS KMS charges apply).
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-ssespecification.html#cfn-dynamodb-globaltable-ssespecification-ssetype
	//
	SseType *string `field:"optional" json:"sseType" yaml:"sseType"`
}

Represents the settings used to enable server-side encryption.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

sSESpecificationProperty := &SSESpecificationProperty{
	SseEnabled: jsii.Boolean(false),

	// the properties below are optional
	SseType: jsii.String("sseType"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-ssespecification.html

type CfnGlobalTable_StreamSpecificationProperty

type CfnGlobalTable_StreamSpecificationProperty struct {
	// When an item in the table is modified, `StreamViewType` determines what information is written to the stream for this table.
	//
	// Valid values for `StreamViewType` are:
	//
	// - `KEYS_ONLY` - Only the key attributes of the modified item are written to the stream.
	// - `NEW_IMAGE` - The entire item, as it appears after it was modified, is written to the stream.
	// - `OLD_IMAGE` - The entire item, as it appeared before it was modified, is written to the stream.
	// - `NEW_AND_OLD_IMAGES` - Both the new and the old item images of the item are written to the stream.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-streamspecification.html#cfn-dynamodb-globaltable-streamspecification-streamviewtype
	//
	StreamViewType *string `field:"required" json:"streamViewType" yaml:"streamViewType"`
}

Represents the DynamoDB Streams configuration for a table in DynamoDB.

You can only modify this value if your `AWS::DynamoDB::GlobalTable` contains only one entry in `Replicas` . You must specify a value for this property if your `AWS::DynamoDB::GlobalTable` contains more than one replica.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

streamSpecificationProperty := &StreamSpecificationProperty{
	StreamViewType: jsii.String("streamViewType"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-streamspecification.html

type CfnGlobalTable_TargetTrackingScalingPolicyConfigurationProperty

type CfnGlobalTable_TargetTrackingScalingPolicyConfigurationProperty struct {
	// Defines a target value for the scaling policy.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-targettrackingscalingpolicyconfiguration.html#cfn-dynamodb-globaltable-targettrackingscalingpolicyconfiguration-targetvalue
	//
	TargetValue *float64 `field:"required" json:"targetValue" yaml:"targetValue"`
	// Indicates whether scale in by the target tracking scaling policy is disabled.
	//
	// The default value is `false` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-targettrackingscalingpolicyconfiguration.html#cfn-dynamodb-globaltable-targettrackingscalingpolicyconfiguration-disablescalein
	//
	DisableScaleIn interface{} `field:"optional" json:"disableScaleIn" yaml:"disableScaleIn"`
	// The amount of time, in seconds, after a scale-in activity completes before another scale-in activity can start.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-targettrackingscalingpolicyconfiguration.html#cfn-dynamodb-globaltable-targettrackingscalingpolicyconfiguration-scaleincooldown
	//
	ScaleInCooldown *float64 `field:"optional" json:"scaleInCooldown" yaml:"scaleInCooldown"`
	// The amount of time, in seconds, after a scale-out activity completes before another scale-out activity can start.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-targettrackingscalingpolicyconfiguration.html#cfn-dynamodb-globaltable-targettrackingscalingpolicyconfiguration-scaleoutcooldown
	//
	ScaleOutCooldown *float64 `field:"optional" json:"scaleOutCooldown" yaml:"scaleOutCooldown"`
}

Defines a target tracking scaling policy.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

targetTrackingScalingPolicyConfigurationProperty := &TargetTrackingScalingPolicyConfigurationProperty{
	TargetValue: jsii.Number(123),

	// the properties below are optional
	DisableScaleIn: jsii.Boolean(false),
	ScaleInCooldown: jsii.Number(123),
	ScaleOutCooldown: jsii.Number(123),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-targettrackingscalingpolicyconfiguration.html

type CfnGlobalTable_TimeToLiveSpecificationProperty

type CfnGlobalTable_TimeToLiveSpecificationProperty struct {
	// Indicates whether TTL is to be enabled (true) or disabled (false) on the table.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-timetolivespecification.html#cfn-dynamodb-globaltable-timetolivespecification-enabled
	//
	Enabled interface{} `field:"required" json:"enabled" yaml:"enabled"`
	// The name of the attribute used to store the expiration time for items in the table.
	//
	// Currently, you cannot directly change the attribute name used to evaluate time to live. In order to do so, you must first disable time to live, and then re-enable it with the new attribute name. It can take up to one hour for changes to time to live to take effect. If you attempt to modify time to live within that time window, your stack operation might be delayed.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-timetolivespecification.html#cfn-dynamodb-globaltable-timetolivespecification-attributename
	//
	AttributeName *string `field:"optional" json:"attributeName" yaml:"attributeName"`
}

Represents the settings used to enable or disable Time to Live (TTL) for the specified table.

All replicas will have the same time to live configuration.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

timeToLiveSpecificationProperty := &TimeToLiveSpecificationProperty{
	Enabled: jsii.Boolean(false),

	// the properties below are optional
	AttributeName: jsii.String("attributeName"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-timetolivespecification.html

type CfnGlobalTable_WriteProvisionedThroughputSettingsProperty

type CfnGlobalTable_WriteProvisionedThroughputSettingsProperty struct {
	// Specifies auto scaling settings for the replica table or global secondary index.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-writeprovisionedthroughputsettings.html#cfn-dynamodb-globaltable-writeprovisionedthroughputsettings-writecapacityautoscalingsettings
	//
	WriteCapacityAutoScalingSettings interface{} `field:"optional" json:"writeCapacityAutoScalingSettings" yaml:"writeCapacityAutoScalingSettings"`
}

Specifies an auto scaling policy for write capacity.

This policy will be applied to all replicas. This setting must be specified if `BillingMode` is set to `PROVISIONED` .

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

writeProvisionedThroughputSettingsProperty := &WriteProvisionedThroughputSettingsProperty{
	WriteCapacityAutoScalingSettings: &CapacityAutoScalingSettingsProperty{
		MaxCapacity: jsii.Number(123),
		MinCapacity: jsii.Number(123),
		TargetTrackingScalingPolicyConfiguration: &TargetTrackingScalingPolicyConfigurationProperty{
			TargetValue: jsii.Number(123),

			// the properties below are optional
			DisableScaleIn: jsii.Boolean(false),
			ScaleInCooldown: jsii.Number(123),
			ScaleOutCooldown: jsii.Number(123),
		},

		// the properties below are optional
		SeedCapacity: jsii.Number(123),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-globaltable-writeprovisionedthroughputsettings.html

type CfnTable

type CfnTable interface {
	awscdk.CfnResource
	awscdk.IInspectable
	awscdk.ITaggable
	// The Amazon Resource Name (ARN) of the DynamoDB table, such as `arn:aws:dynamodb:us-east-2:123456789012:table/myDynamoDBTable` .
	AttrArn() *string
	// A list of attributes that describe the key schema for the table and indexes.
	AttributeDefinitions() interface{}
	SetAttributeDefinitions(val interface{})
	// The ARN of the DynamoDB stream, such as `arn:aws:dynamodb:us-east-1:123456789012:table/testddbstack-myDynamoDBTable-012A1SL7SMP5Q/stream/2015-11-30T20:10:00.000` .
	//
	// > You must specify the `StreamSpecification` property to use this attribute.
	AttrStreamArn() *string
	// Specify how you are charged for read and write throughput and how you manage capacity.
	BillingMode() *string
	SetBillingMode(val *string)
	// Options for this resource, such as condition, update policy etc.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	CfnResourceType() *string
	// The settings used to enable or disable CloudWatch Contributor Insights for the specified table.
	ContributorInsightsSpecification() interface{}
	SetContributorInsightsSpecification(val interface{})
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	CreationStack() *[]*string
	// Determines if a table is protected from deletion.
	DeletionProtectionEnabled() interface{}
	SetDeletionProtectionEnabled(val interface{})
	// Global secondary indexes to be created on the table.
	//
	// You can create up to 20 global secondary indexes.
	GlobalSecondaryIndexes() interface{}
	SetGlobalSecondaryIndexes(val interface{})
	// Specifies the properties of data being imported from the S3 bucket source to the table.
	ImportSourceSpecification() interface{}
	SetImportSourceSpecification(val interface{})
	// Specifies the attributes that make up the primary key for the table.
	KeySchema() interface{}
	SetKeySchema(val interface{})
	// The Kinesis Data Streams configuration for the specified table.
	KinesisStreamSpecification() interface{}
	SetKinesisStreamSpecification(val interface{})
	// Local secondary indexes to be created on the table.
	LocalSecondaryIndexes() interface{}
	SetLocalSecondaryIndexes(val interface{})
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	LogicalId() *string
	// The tree node.
	Node() constructs.Node
	// The settings used to enable point in time recovery.
	PointInTimeRecoverySpecification() interface{}
	SetPointInTimeRecoverySpecification(val interface{})
	// Throughput for the specified table, which consists of values for `ReadCapacityUnits` and `WriteCapacityUnits` .
	ProvisionedThroughput() interface{}
	SetProvisionedThroughput(val interface{})
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	Ref() *string
	// Specifies the settings to enable server-side encryption.
	SseSpecification() interface{}
	SetSseSpecification(val interface{})
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	Stack() awscdk.Stack
	// The settings for the DynamoDB table stream, which capture changes to items stored in the table.
	StreamSpecification() interface{}
	SetStreamSpecification(val interface{})
	// The table class of the new table.
	TableClass() *string
	SetTableClass(val *string)
	// A name for the table.
	TableName() *string
	SetTableName(val *string)
	// Tag Manager which manages the tags for this resource.
	Tags() awscdk.TagManager
	// An array of key-value pairs to apply to this resource.
	TagsRaw() *[]*awscdk.CfnTag
	SetTagsRaw(val *[]*awscdk.CfnTag)
	// Specifies the Time to Live (TTL) settings for the table.
	TimeToLiveSpecification() interface{}
	SetTimeToLiveSpecification(val interface{})
	// Deprecated.
	// Deprecated: use `updatedProperties`
	//
	// Return properties modified after initiation
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperites() *map[string]interface{}
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperties() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	AddDependency(target awscdk.CfnResource)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	// Deprecated: use addDependency.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//   "GlobalSecondaryIndexes": [
	//     {
	//       "Projection": {
	//         "NonKeyAttributes": [ "myattribute" ]
	//         ...
	//       }
	//       ...
	//     },
	//     {
	//       "ProjectionType": "INCLUDE"
	//       ...
	//     },
	//   ]
	//   ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
	// cases, a snapshot can be taken of the resource prior to deletion
	// (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
	// can be found in the following link:.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options
	//
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Retrieves an array of resources this resource depends on.
	//
	// This assembles dependencies on resources across stacks (including nested stacks)
	// automatically.
	ObtainDependencies() *[]interface{}
	// Get a shallow copy of dependencies between this resource and other resources in the same stack.
	ObtainResourceDependencies() *[]awscdk.CfnResource
	// Overrides the auto-generated logical ID with a specific ID.
	OverrideLogicalId(newLogicalId *string)
	// Indicates that this resource no longer depends on another resource.
	//
	// This can be used for resources across stacks (including nested stacks)
	// and the dependency will automatically be removed from the relevant scope.
	RemoveDependency(target awscdk.CfnResource)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Replaces one dependency with another.
	ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource)
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	ShouldSynthesize() *bool
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	ToString() *string
	ValidateProperties(_properties interface{})
}

The `AWS::DynamoDB::Table` resource creates a DynamoDB table. For more information, see [CreateTable](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_CreateTable.html) in the *Amazon DynamoDB API Reference* .

You should be aware of the following behaviors when working with DynamoDB tables:

- AWS CloudFormation typically creates DynamoDB tables in parallel. However, if your template includes multiple DynamoDB tables with indexes, you must declare dependencies so that the tables are created sequentially. Amazon DynamoDB limits the number of tables with secondary indexes that are in the creating state. If you create multiple tables with indexes at the same time, DynamoDB returns an error and the stack operation fails. For an example, see [DynamoDB Table with a DependsOn Attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#aws-resource-dynamodb-table--examples--DynamoDB_Table_with_a_DependsOn_Attribute) .

> Our guidance is to use the latest schema documented here for your AWS CloudFormation templates. This schema supports the provisioning of all table settings below. When using this schema in your AWS CloudFormation templates, please ensure that your Identity and Access Management ( IAM ) policies are updated with appropriate permissions to allow for the authorization of these setting changes.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnTable := awscdk.Aws_dynamodb.NewCfnTable(this, jsii.String("MyCfnTable"), &CfnTableProps{
	KeySchema: []interface{}{
		&KeySchemaProperty{
			AttributeName: jsii.String("attributeName"),
			KeyType: jsii.String("keyType"),
		},
	},

	// the properties below are optional
	AttributeDefinitions: []interface{}{
		&AttributeDefinitionProperty{
			AttributeName: jsii.String("attributeName"),
			AttributeType: jsii.String("attributeType"),
		},
	},
	BillingMode: jsii.String("billingMode"),
	ContributorInsightsSpecification: &ContributorInsightsSpecificationProperty{
		Enabled: jsii.Boolean(false),
	},
	DeletionProtectionEnabled: jsii.Boolean(false),
	GlobalSecondaryIndexes: []interface{}{
		&GlobalSecondaryIndexProperty{
			IndexName: jsii.String("indexName"),
			KeySchema: []interface{}{
				&KeySchemaProperty{
					AttributeName: jsii.String("attributeName"),
					KeyType: jsii.String("keyType"),
				},
			},
			Projection: &ProjectionProperty{
				NonKeyAttributes: []*string{
					jsii.String("nonKeyAttributes"),
				},
				ProjectionType: jsii.String("projectionType"),
			},

			// the properties below are optional
			ContributorInsightsSpecification: &ContributorInsightsSpecificationProperty{
				Enabled: jsii.Boolean(false),
			},
			ProvisionedThroughput: &ProvisionedThroughputProperty{
				ReadCapacityUnits: jsii.Number(123),
				WriteCapacityUnits: jsii.Number(123),
			},
		},
	},
	ImportSourceSpecification: &ImportSourceSpecificationProperty{
		InputFormat: jsii.String("inputFormat"),
		S3BucketSource: &S3BucketSourceProperty{
			S3Bucket: jsii.String("s3Bucket"),

			// the properties below are optional
			S3BucketOwner: jsii.String("s3BucketOwner"),
			S3KeyPrefix: jsii.String("s3KeyPrefix"),
		},

		// the properties below are optional
		InputCompressionType: jsii.String("inputCompressionType"),
		InputFormatOptions: &InputFormatOptionsProperty{
			Csv: &CsvProperty{
				Delimiter: jsii.String("delimiter"),
				HeaderList: []*string{
					jsii.String("headerList"),
				},
			},
		},
	},
	KinesisStreamSpecification: &KinesisStreamSpecificationProperty{
		StreamArn: jsii.String("streamArn"),

		// the properties below are optional
		ApproximateCreationDateTimePrecision: jsii.String("approximateCreationDateTimePrecision"),
	},
	LocalSecondaryIndexes: []interface{}{
		&LocalSecondaryIndexProperty{
			IndexName: jsii.String("indexName"),
			KeySchema: []interface{}{
				&KeySchemaProperty{
					AttributeName: jsii.String("attributeName"),
					KeyType: jsii.String("keyType"),
				},
			},
			Projection: &ProjectionProperty{
				NonKeyAttributes: []*string{
					jsii.String("nonKeyAttributes"),
				},
				ProjectionType: jsii.String("projectionType"),
			},
		},
	},
	PointInTimeRecoverySpecification: &PointInTimeRecoverySpecificationProperty{
		PointInTimeRecoveryEnabled: jsii.Boolean(false),
	},
	ProvisionedThroughput: &ProvisionedThroughputProperty{
		ReadCapacityUnits: jsii.Number(123),
		WriteCapacityUnits: jsii.Number(123),
	},
	SseSpecification: &SSESpecificationProperty{
		SseEnabled: jsii.Boolean(false),

		// the properties below are optional
		KmsMasterKeyId: jsii.String("kmsMasterKeyId"),
		SseType: jsii.String("sseType"),
	},
	StreamSpecification: &StreamSpecificationProperty{
		StreamViewType: jsii.String("streamViewType"),
	},
	TableClass: jsii.String("tableClass"),
	TableName: jsii.String("tableName"),
	Tags: []cfnTag{
		&cfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
	TimeToLiveSpecification: &TimeToLiveSpecificationProperty{
		Enabled: jsii.Boolean(false),

		// the properties below are optional
		AttributeName: jsii.String("attributeName"),
	},
})

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html

func NewCfnTable

func NewCfnTable(scope constructs.Construct, id *string, props *CfnTableProps) CfnTable

type CfnTableProps

type CfnTableProps struct {
	// Specifies the attributes that make up the primary key for the table.
	//
	// The attributes in the `KeySchema` property must also be defined in the `AttributeDefinitions` property.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-keyschema
	//
	KeySchema interface{} `field:"required" json:"keySchema" yaml:"keySchema"`
	// A list of attributes that describe the key schema for the table and indexes.
	//
	// This property is required to create a DynamoDB table.
	//
	// Update requires: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt) . Replacement if you edit an existing AttributeDefinition.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-attributedefinitions
	//
	AttributeDefinitions interface{} `field:"optional" json:"attributeDefinitions" yaml:"attributeDefinitions"`
	// Specify how you are charged for read and write throughput and how you manage capacity.
	//
	// Valid values include:
	//
	// - `PROVISIONED` - We recommend using `PROVISIONED` for predictable workloads. `PROVISIONED` sets the billing mode to [Provisioned Mode](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html#HowItWorks.ProvisionedThroughput.Manual) .
	// - `PAY_PER_REQUEST` - We recommend using `PAY_PER_REQUEST` for unpredictable workloads. `PAY_PER_REQUEST` sets the billing mode to [On-Demand Mode](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html#HowItWorks.OnDemand) .
	//
	// If not specified, the default is `PROVISIONED` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-billingmode
	//
	BillingMode *string `field:"optional" json:"billingMode" yaml:"billingMode"`
	// The settings used to enable or disable CloudWatch Contributor Insights for the specified table.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-contributorinsightsspecification
	//
	ContributorInsightsSpecification interface{} `field:"optional" json:"contributorInsightsSpecification" yaml:"contributorInsightsSpecification"`
	// Determines if a table is protected from deletion.
	//
	// When enabled, the table cannot be deleted by any user or process. This setting is disabled by default. For more information, see [Using deletion protection](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.Basics.html#WorkingWithTables.Basics.DeletionProtection) in the *Amazon DynamoDB Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-deletionprotectionenabled
	//
	DeletionProtectionEnabled interface{} `field:"optional" json:"deletionProtectionEnabled" yaml:"deletionProtectionEnabled"`
	// Global secondary indexes to be created on the table. You can create up to 20 global secondary indexes.
	//
	// > If you update a table to include a new global secondary index, AWS CloudFormation initiates the index creation and then proceeds with the stack update. AWS CloudFormation doesn't wait for the index to complete creation because the backfilling phase can take a long time, depending on the size of the table. You can't use the index or update the table until the index's status is `ACTIVE` . You can track its status by using the DynamoDB [DescribeTable](https://docs.aws.amazon.com/cli/latest/reference/dynamodb/describe-table.html) command.
	// >
	// > If you add or delete an index during an update, we recommend that you don't update any other resources. If your stack fails to update and is rolled back while adding a new index, you must manually delete the index.
	// >
	// > Updates are not supported. The following are exceptions:
	// >
	// > - If you update either the contributor insights specification or the provisioned throughput values of global secondary indexes, you can update the table without interruption.
	// > - You can delete or add one global secondary index without interruption. If you do both in the same update (for example, by changing the index's logical ID), the update fails.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-globalsecondaryindexes
	//
	GlobalSecondaryIndexes interface{} `field:"optional" json:"globalSecondaryIndexes" yaml:"globalSecondaryIndexes"`
	// Specifies the properties of data being imported from the S3 bucket source to the table.
	//
	// > If you specify the `ImportSourceSpecification` property, and also specify either the `StreamSpecification` , the `TableClass` property, or the `DeletionProtectionEnabled` property, the IAM entity creating/updating stack must have `UpdateTable` permission.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-importsourcespecification
	//
	ImportSourceSpecification interface{} `field:"optional" json:"importSourceSpecification" yaml:"importSourceSpecification"`
	// The Kinesis Data Streams configuration for the specified table.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-kinesisstreamspecification
	//
	KinesisStreamSpecification interface{} `field:"optional" json:"kinesisStreamSpecification" yaml:"kinesisStreamSpecification"`
	// Local secondary indexes to be created on the table.
	//
	// You can create up to 5 local secondary indexes. Each index is scoped to a given hash key value. The size of each hash key can be up to 10 gigabytes.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-localsecondaryindexes
	//
	LocalSecondaryIndexes interface{} `field:"optional" json:"localSecondaryIndexes" yaml:"localSecondaryIndexes"`
	// The settings used to enable point in time recovery.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-pointintimerecoveryspecification
	//
	PointInTimeRecoverySpecification interface{} `field:"optional" json:"pointInTimeRecoverySpecification" yaml:"pointInTimeRecoverySpecification"`
	// Throughput for the specified table, which consists of values for `ReadCapacityUnits` and `WriteCapacityUnits` .
	//
	// For more information about the contents of a provisioned throughput structure, see [Amazon DynamoDB Table ProvisionedThroughput](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ProvisionedThroughput.html) .
	//
	// If you set `BillingMode` as `PROVISIONED` , you must specify this property. If you set `BillingMode` as `PAY_PER_REQUEST` , you cannot specify this property.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-provisionedthroughput
	//
	ProvisionedThroughput interface{} `field:"optional" json:"provisionedThroughput" yaml:"provisionedThroughput"`
	// Specifies the settings to enable server-side encryption.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-ssespecification
	//
	SseSpecification interface{} `field:"optional" json:"sseSpecification" yaml:"sseSpecification"`
	// The settings for the DynamoDB table stream, which capture changes to items stored in the table.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-streamspecification
	//
	StreamSpecification interface{} `field:"optional" json:"streamSpecification" yaml:"streamSpecification"`
	// The table class of the new table.
	//
	// Valid values are `STANDARD` and `STANDARD_INFREQUENT_ACCESS` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-tableclass
	//
	TableClass *string `field:"optional" json:"tableClass" yaml:"tableClass"`
	// A name for the table.
	//
	// If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the table name. For more information, see [Name Type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html) .
	//
	// > If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-tablename
	//
	TableName *string `field:"optional" json:"tableName" yaml:"tableName"`
	// An array of key-value pairs to apply to this resource.
	//
	// For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html) .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-tags
	//
	Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"`
	// Specifies the Time to Live (TTL) settings for the table.
	//
	// > For detailed information about the limits in DynamoDB, see [Limits in Amazon DynamoDB](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) in the Amazon DynamoDB Developer Guide.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html#cfn-dynamodb-table-timetolivespecification
	//
	TimeToLiveSpecification interface{} `field:"optional" json:"timeToLiveSpecification" yaml:"timeToLiveSpecification"`
}

Properties for defining a `CfnTable`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnTableProps := &CfnTableProps{
	KeySchema: []interface{}{
		&KeySchemaProperty{
			AttributeName: jsii.String("attributeName"),
			KeyType: jsii.String("keyType"),
		},
	},

	// the properties below are optional
	AttributeDefinitions: []interface{}{
		&AttributeDefinitionProperty{
			AttributeName: jsii.String("attributeName"),
			AttributeType: jsii.String("attributeType"),
		},
	},
	BillingMode: jsii.String("billingMode"),
	ContributorInsightsSpecification: &ContributorInsightsSpecificationProperty{
		Enabled: jsii.Boolean(false),
	},
	DeletionProtectionEnabled: jsii.Boolean(false),
	GlobalSecondaryIndexes: []interface{}{
		&GlobalSecondaryIndexProperty{
			IndexName: jsii.String("indexName"),
			KeySchema: []interface{}{
				&KeySchemaProperty{
					AttributeName: jsii.String("attributeName"),
					KeyType: jsii.String("keyType"),
				},
			},
			Projection: &ProjectionProperty{
				NonKeyAttributes: []*string{
					jsii.String("nonKeyAttributes"),
				},
				ProjectionType: jsii.String("projectionType"),
			},

			// the properties below are optional
			ContributorInsightsSpecification: &ContributorInsightsSpecificationProperty{
				Enabled: jsii.Boolean(false),
			},
			ProvisionedThroughput: &ProvisionedThroughputProperty{
				ReadCapacityUnits: jsii.Number(123),
				WriteCapacityUnits: jsii.Number(123),
			},
		},
	},
	ImportSourceSpecification: &ImportSourceSpecificationProperty{
		InputFormat: jsii.String("inputFormat"),
		S3BucketSource: &S3BucketSourceProperty{
			S3Bucket: jsii.String("s3Bucket"),

			// the properties below are optional
			S3BucketOwner: jsii.String("s3BucketOwner"),
			S3KeyPrefix: jsii.String("s3KeyPrefix"),
		},

		// the properties below are optional
		InputCompressionType: jsii.String("inputCompressionType"),
		InputFormatOptions: &InputFormatOptionsProperty{
			Csv: &CsvProperty{
				Delimiter: jsii.String("delimiter"),
				HeaderList: []*string{
					jsii.String("headerList"),
				},
			},
		},
	},
	KinesisStreamSpecification: &KinesisStreamSpecificationProperty{
		StreamArn: jsii.String("streamArn"),

		// the properties below are optional
		ApproximateCreationDateTimePrecision: jsii.String("approximateCreationDateTimePrecision"),
	},
	LocalSecondaryIndexes: []interface{}{
		&LocalSecondaryIndexProperty{
			IndexName: jsii.String("indexName"),
			KeySchema: []interface{}{
				&KeySchemaProperty{
					AttributeName: jsii.String("attributeName"),
					KeyType: jsii.String("keyType"),
				},
			},
			Projection: &ProjectionProperty{
				NonKeyAttributes: []*string{
					jsii.String("nonKeyAttributes"),
				},
				ProjectionType: jsii.String("projectionType"),
			},
		},
	},
	PointInTimeRecoverySpecification: &PointInTimeRecoverySpecificationProperty{
		PointInTimeRecoveryEnabled: jsii.Boolean(false),
	},
	ProvisionedThroughput: &ProvisionedThroughputProperty{
		ReadCapacityUnits: jsii.Number(123),
		WriteCapacityUnits: jsii.Number(123),
	},
	SseSpecification: &SSESpecificationProperty{
		SseEnabled: jsii.Boolean(false),

		// the properties below are optional
		KmsMasterKeyId: jsii.String("kmsMasterKeyId"),
		SseType: jsii.String("sseType"),
	},
	StreamSpecification: &StreamSpecificationProperty{
		StreamViewType: jsii.String("streamViewType"),
	},
	TableClass: jsii.String("tableClass"),
	TableName: jsii.String("tableName"),
	Tags: []cfnTag{
		&cfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
	TimeToLiveSpecification: &TimeToLiveSpecificationProperty{
		Enabled: jsii.Boolean(false),

		// the properties below are optional
		AttributeName: jsii.String("attributeName"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html

type CfnTable_AttributeDefinitionProperty

type CfnTable_AttributeDefinitionProperty struct {
	// A name for the attribute.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-attributedefinition.html#cfn-dynamodb-table-attributedefinition-attributename
	//
	AttributeName *string `field:"required" json:"attributeName" yaml:"attributeName"`
	// The data type for the attribute, where:.
	//
	// - `S` - the attribute is of type String
	// - `N` - the attribute is of type Number
	// - `B` - the attribute is of type Binary.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-attributedefinition.html#cfn-dynamodb-table-attributedefinition-attributetype
	//
	AttributeType *string `field:"required" json:"attributeType" yaml:"attributeType"`
}

Represents an attribute for describing the schema for the table and indexes.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

attributeDefinitionProperty := &AttributeDefinitionProperty{
	AttributeName: jsii.String("attributeName"),
	AttributeType: jsii.String("attributeType"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-attributedefinition.html

type CfnTable_ContributorInsightsSpecificationProperty

type CfnTable_ContributorInsightsSpecificationProperty struct {
	// Indicates whether CloudWatch Contributor Insights are to be enabled (true) or disabled (false).
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-contributorinsightsspecification.html#cfn-dynamodb-table-contributorinsightsspecification-enabled
	//
	Enabled interface{} `field:"required" json:"enabled" yaml:"enabled"`
}

The settings used to enable or disable CloudWatch Contributor Insights.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

contributorInsightsSpecificationProperty := &ContributorInsightsSpecificationProperty{
	Enabled: jsii.Boolean(false),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-contributorinsightsspecification.html

type CfnTable_CsvProperty added in v2.45.0

type CfnTable_CsvProperty struct {
	// The delimiter used for separating items in the CSV file being imported.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-csv.html#cfn-dynamodb-table-csv-delimiter
	//
	Delimiter *string `field:"optional" json:"delimiter" yaml:"delimiter"`
	// List of the headers used to specify a common header for all source CSV files being imported.
	//
	// If this field is specified then the first line of each CSV file is treated as data instead of the header. If this field is not specified the the first line of each CSV file is treated as the header.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-csv.html#cfn-dynamodb-table-csv-headerlist
	//
	HeaderList *[]*string `field:"optional" json:"headerList" yaml:"headerList"`
}

The options for imported source files in CSV format.

The values are Delimiter and HeaderList.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

csvProperty := &CsvProperty{
	Delimiter: jsii.String("delimiter"),
	HeaderList: []*string{
		jsii.String("headerList"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-csv.html

type CfnTable_GlobalSecondaryIndexProperty

type CfnTable_GlobalSecondaryIndexProperty struct {
	// The name of the global secondary index.
	//
	// The name must be unique among all other indexes on this table.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-globalsecondaryindex.html#cfn-dynamodb-table-globalsecondaryindex-indexname
	//
	IndexName *string `field:"required" json:"indexName" yaml:"indexName"`
	// The complete key schema for a global secondary index, which consists of one or more pairs of attribute names and key types:  - `HASH` - partition key - `RANGE` - sort key  > The partition key of an item is also known as its *hash attribute* .
	//
	// The term "hash attribute" derives from DynamoDB's usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values.
	// >
	// > The sort key of an item is also known as its *range attribute* . The term "range attribute" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-globalsecondaryindex.html#cfn-dynamodb-table-globalsecondaryindex-keyschema
	//
	KeySchema interface{} `field:"required" json:"keySchema" yaml:"keySchema"`
	// Represents attributes that are copied (projected) from the table into the global secondary index.
	//
	// These are in addition to the primary key attributes and index key attributes, which are automatically projected.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-globalsecondaryindex.html#cfn-dynamodb-table-globalsecondaryindex-projection
	//
	Projection interface{} `field:"required" json:"projection" yaml:"projection"`
	// The settings used to enable or disable CloudWatch Contributor Insights for the specified global secondary index.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-globalsecondaryindex.html#cfn-dynamodb-table-globalsecondaryindex-contributorinsightsspecification
	//
	ContributorInsightsSpecification interface{} `field:"optional" json:"contributorInsightsSpecification" yaml:"contributorInsightsSpecification"`
	// Represents the provisioned throughput settings for the specified global secondary index.
	//
	// For current minimum and maximum provisioned throughput values, see [Service, Account, and Table Quotas](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) in the *Amazon DynamoDB Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-globalsecondaryindex.html#cfn-dynamodb-table-globalsecondaryindex-provisionedthroughput
	//
	ProvisionedThroughput interface{} `field:"optional" json:"provisionedThroughput" yaml:"provisionedThroughput"`
}

Represents the properties of a global secondary index.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

globalSecondaryIndexProperty := &GlobalSecondaryIndexProperty{
	IndexName: jsii.String("indexName"),
	KeySchema: []interface{}{
		&KeySchemaProperty{
			AttributeName: jsii.String("attributeName"),
			KeyType: jsii.String("keyType"),
		},
	},
	Projection: &ProjectionProperty{
		NonKeyAttributes: []*string{
			jsii.String("nonKeyAttributes"),
		},
		ProjectionType: jsii.String("projectionType"),
	},

	// the properties below are optional
	ContributorInsightsSpecification: &ContributorInsightsSpecificationProperty{
		Enabled: jsii.Boolean(false),
	},
	ProvisionedThroughput: &ProvisionedThroughputProperty{
		ReadCapacityUnits: jsii.Number(123),
		WriteCapacityUnits: jsii.Number(123),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-globalsecondaryindex.html

type CfnTable_ImportSourceSpecificationProperty added in v2.45.0

type CfnTable_ImportSourceSpecificationProperty struct {
	// The format of the source data.
	//
	// Valid values for `ImportFormat` are `CSV` , `DYNAMODB_JSON` or `ION` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-importsourcespecification.html#cfn-dynamodb-table-importsourcespecification-inputformat
	//
	InputFormat *string `field:"required" json:"inputFormat" yaml:"inputFormat"`
	// The S3 bucket that provides the source for the import.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-importsourcespecification.html#cfn-dynamodb-table-importsourcespecification-s3bucketsource
	//
	S3BucketSource interface{} `field:"required" json:"s3BucketSource" yaml:"s3BucketSource"`
	// Type of compression to be used on the input coming from the imported table.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-importsourcespecification.html#cfn-dynamodb-table-importsourcespecification-inputcompressiontype
	//
	InputCompressionType *string `field:"optional" json:"inputCompressionType" yaml:"inputCompressionType"`
	// Additional properties that specify how the input is formatted,.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-importsourcespecification.html#cfn-dynamodb-table-importsourcespecification-inputformatoptions
	//
	InputFormatOptions interface{} `field:"optional" json:"inputFormatOptions" yaml:"inputFormatOptions"`
}

Specifies the properties of data being imported from the S3 bucket source to the table.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

importSourceSpecificationProperty := &ImportSourceSpecificationProperty{
	InputFormat: jsii.String("inputFormat"),
	S3BucketSource: &S3BucketSourceProperty{
		S3Bucket: jsii.String("s3Bucket"),

		// the properties below are optional
		S3BucketOwner: jsii.String("s3BucketOwner"),
		S3KeyPrefix: jsii.String("s3KeyPrefix"),
	},

	// the properties below are optional
	InputCompressionType: jsii.String("inputCompressionType"),
	InputFormatOptions: &InputFormatOptionsProperty{
		Csv: &CsvProperty{
			Delimiter: jsii.String("delimiter"),
			HeaderList: []*string{
				jsii.String("headerList"),
			},
		},
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-importsourcespecification.html

type CfnTable_InputFormatOptionsProperty added in v2.45.0

type CfnTable_InputFormatOptionsProperty struct {
	// The options for imported source files in CSV format.
	//
	// The values are Delimiter and HeaderList.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-inputformatoptions.html#cfn-dynamodb-table-inputformatoptions-csv
	//
	Csv interface{} `field:"optional" json:"csv" yaml:"csv"`
}

The format options for the data that was imported into the target table.

There is one value, CsvOption.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

inputFormatOptionsProperty := &InputFormatOptionsProperty{
	Csv: &CsvProperty{
		Delimiter: jsii.String("delimiter"),
		HeaderList: []*string{
			jsii.String("headerList"),
		},
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-inputformatoptions.html

type CfnTable_KeySchemaProperty

type CfnTable_KeySchemaProperty struct {
	// The name of a key attribute.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-keyschema.html#cfn-dynamodb-table-keyschema-attributename
	//
	AttributeName *string `field:"required" json:"attributeName" yaml:"attributeName"`
	// The role that this key attribute will assume:.
	//
	// - `HASH` - partition key
	// - `RANGE` - sort key
	//
	// > The partition key of an item is also known as its *hash attribute* . The term "hash attribute" derives from DynamoDB's usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values.
	// >
	// > The sort key of an item is also known as its *range attribute* . The term "range attribute" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-keyschema.html#cfn-dynamodb-table-keyschema-keytype
	//
	KeyType *string `field:"required" json:"keyType" yaml:"keyType"`
}

Represents *a single element* of a key schema.

A key schema specifies the attributes that make up the primary key of a table, or the key attributes of an index.

A `KeySchemaElement` represents exactly one attribute of the primary key. For example, a simple primary key would be represented by one `KeySchemaElement` (for the partition key). A composite primary key would require one `KeySchemaElement` for the partition key, and another `KeySchemaElement` for the sort key.

A `KeySchemaElement` must be a scalar, top-level attribute (not a nested attribute). The data type must be one of String, Number, or Binary. The attribute cannot be nested within a List or a Map.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

keySchemaProperty := &KeySchemaProperty{
	AttributeName: jsii.String("attributeName"),
	KeyType: jsii.String("keyType"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-keyschema.html

type CfnTable_KinesisStreamSpecificationProperty

type CfnTable_KinesisStreamSpecificationProperty struct {
	// The ARN for a specific Kinesis data stream.
	//
	// Length Constraints: Minimum length of 37. Maximum length of 1024.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-kinesisstreamspecification.html#cfn-dynamodb-table-kinesisstreamspecification-streamarn
	//
	StreamArn *string `field:"required" json:"streamArn" yaml:"streamArn"`
	// The precision for the time and date that the stream was created.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-kinesisstreamspecification.html#cfn-dynamodb-table-kinesisstreamspecification-approximatecreationdatetimeprecision
	//
	ApproximateCreationDateTimePrecision *string `field:"optional" json:"approximateCreationDateTimePrecision" yaml:"approximateCreationDateTimePrecision"`
}

The Kinesis Data Streams configuration for the specified table.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

kinesisStreamSpecificationProperty := &KinesisStreamSpecificationProperty{
	StreamArn: jsii.String("streamArn"),

	// the properties below are optional
	ApproximateCreationDateTimePrecision: jsii.String("approximateCreationDateTimePrecision"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-kinesisstreamspecification.html

type CfnTable_LocalSecondaryIndexProperty

type CfnTable_LocalSecondaryIndexProperty struct {
	// The name of the local secondary index.
	//
	// The name must be unique among all other indexes on this table.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-localsecondaryindex.html#cfn-dynamodb-table-localsecondaryindex-indexname
	//
	IndexName *string `field:"required" json:"indexName" yaml:"indexName"`
	// The complete key schema for the local secondary index, consisting of one or more pairs of attribute names and key types:  - `HASH` - partition key - `RANGE` - sort key  > The partition key of an item is also known as its *hash attribute* .
	//
	// The term "hash attribute" derives from DynamoDB's usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values.
	// >
	// > The sort key of an item is also known as its *range attribute* . The term "range attribute" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-localsecondaryindex.html#cfn-dynamodb-table-localsecondaryindex-keyschema
	//
	KeySchema interface{} `field:"required" json:"keySchema" yaml:"keySchema"`
	// Represents attributes that are copied (projected) from the table into the local secondary index.
	//
	// These are in addition to the primary key attributes and index key attributes, which are automatically projected.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-localsecondaryindex.html#cfn-dynamodb-table-localsecondaryindex-projection
	//
	Projection interface{} `field:"required" json:"projection" yaml:"projection"`
}

Represents the properties of a local secondary index.

A local secondary index can only be created when its parent table is created.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

localSecondaryIndexProperty := &LocalSecondaryIndexProperty{
	IndexName: jsii.String("indexName"),
	KeySchema: []interface{}{
		&KeySchemaProperty{
			AttributeName: jsii.String("attributeName"),
			KeyType: jsii.String("keyType"),
		},
	},
	Projection: &ProjectionProperty{
		NonKeyAttributes: []*string{
			jsii.String("nonKeyAttributes"),
		},
		ProjectionType: jsii.String("projectionType"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-localsecondaryindex.html

type CfnTable_PointInTimeRecoverySpecificationProperty

type CfnTable_PointInTimeRecoverySpecificationProperty struct {
	// Indicates whether point in time recovery is enabled (true) or disabled (false) on the table.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-pointintimerecoveryspecification.html#cfn-dynamodb-table-pointintimerecoveryspecification-pointintimerecoveryenabled
	//
	PointInTimeRecoveryEnabled interface{} `field:"optional" json:"pointInTimeRecoveryEnabled" yaml:"pointInTimeRecoveryEnabled"`
}

The settings used to enable point in time recovery.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

pointInTimeRecoverySpecificationProperty := &PointInTimeRecoverySpecificationProperty{
	PointInTimeRecoveryEnabled: jsii.Boolean(false),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-pointintimerecoveryspecification.html

type CfnTable_ProjectionProperty

type CfnTable_ProjectionProperty struct {
	// Represents the non-key attribute names which will be projected into the index.
	//
	// For local secondary indexes, the total count of `NonKeyAttributes` summed across all of the local secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-projection.html#cfn-dynamodb-table-projection-nonkeyattributes
	//
	NonKeyAttributes *[]*string `field:"optional" json:"nonKeyAttributes" yaml:"nonKeyAttributes"`
	// The set of attributes that are projected into the index:.
	//
	// - `KEYS_ONLY` - Only the index and primary keys are projected into the index.
	// - `INCLUDE` - In addition to the attributes described in `KEYS_ONLY` , the secondary index will include other non-key attributes that you specify.
	// - `ALL` - All of the table attributes are projected into the index.
	//
	// When using the DynamoDB console, `ALL` is selected by default.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-projection.html#cfn-dynamodb-table-projection-projectiontype
	//
	ProjectionType *string `field:"optional" json:"projectionType" yaml:"projectionType"`
}

Represents attributes that are copied (projected) from the table into an index.

These are in addition to the primary key attributes and index key attributes, which are automatically projected.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

projectionProperty := &ProjectionProperty{
	NonKeyAttributes: []*string{
		jsii.String("nonKeyAttributes"),
	},
	ProjectionType: jsii.String("projectionType"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-projection.html

type CfnTable_ProvisionedThroughputProperty

type CfnTable_ProvisionedThroughputProperty struct {
	// The maximum number of strongly consistent reads consumed per second before DynamoDB returns a `ThrottlingException` .
	//
	// For more information, see [Specifying Read and Write Requirements](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughput.html) in the *Amazon DynamoDB Developer Guide* .
	//
	// If read/write capacity mode is `PAY_PER_REQUEST` the value is set to 0.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-provisionedthroughput.html#cfn-dynamodb-table-provisionedthroughput-readcapacityunits
	//
	ReadCapacityUnits *float64 `field:"required" json:"readCapacityUnits" yaml:"readCapacityUnits"`
	// The maximum number of writes consumed per second before DynamoDB returns a `ThrottlingException` .
	//
	// For more information, see [Specifying Read and Write Requirements](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughput.html) in the *Amazon DynamoDB Developer Guide* .
	//
	// If read/write capacity mode is `PAY_PER_REQUEST` the value is set to 0.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-provisionedthroughput.html#cfn-dynamodb-table-provisionedthroughput-writecapacityunits
	//
	WriteCapacityUnits *float64 `field:"required" json:"writeCapacityUnits" yaml:"writeCapacityUnits"`
}

Throughput for the specified table, which consists of values for `ReadCapacityUnits` and `WriteCapacityUnits` .

For more information about the contents of a provisioned throughput structure, see [Amazon DynamoDB Table ProvisionedThroughput](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ProvisionedThroughput.html) .

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

provisionedThroughputProperty := &ProvisionedThroughputProperty{
	ReadCapacityUnits: jsii.Number(123),
	WriteCapacityUnits: jsii.Number(123),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-provisionedthroughput.html

type CfnTable_S3BucketSourceProperty added in v2.45.0

type CfnTable_S3BucketSourceProperty struct {
	// The S3 bucket that is being imported from.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-s3bucketsource.html#cfn-dynamodb-table-s3bucketsource-s3bucket
	//
	S3Bucket *string `field:"required" json:"s3Bucket" yaml:"s3Bucket"`
	// The account number of the S3 bucket that is being imported from.
	//
	// If the bucket is owned by the requester this is optional.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-s3bucketsource.html#cfn-dynamodb-table-s3bucketsource-s3bucketowner
	//
	S3BucketOwner *string `field:"optional" json:"s3BucketOwner" yaml:"s3BucketOwner"`
	// The key prefix shared by all S3 Objects that are being imported.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-s3bucketsource.html#cfn-dynamodb-table-s3bucketsource-s3keyprefix
	//
	S3KeyPrefix *string `field:"optional" json:"s3KeyPrefix" yaml:"s3KeyPrefix"`
}

The S3 bucket that is being imported from.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

s3BucketSourceProperty := &S3BucketSourceProperty{
	S3Bucket: jsii.String("s3Bucket"),

	// the properties below are optional
	S3BucketOwner: jsii.String("s3BucketOwner"),
	S3KeyPrefix: jsii.String("s3KeyPrefix"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-s3bucketsource.html

type CfnTable_SSESpecificationProperty

type CfnTable_SSESpecificationProperty struct {
	// Indicates whether server-side encryption is done using an AWS managed key or an AWS owned key.
	//
	// If enabled (true), server-side encryption type is set to `KMS` and an AWS managed key is used ( AWS KMS charges apply). If disabled (false) or not specified, server-side encryption is set to AWS owned key.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-ssespecification.html#cfn-dynamodb-table-ssespecification-sseenabled
	//
	SseEnabled interface{} `field:"required" json:"sseEnabled" yaml:"sseEnabled"`
	// The AWS KMS key that should be used for the AWS KMS encryption.
	//
	// To specify a key, use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. Note that you should only provide this parameter if the key is different from the default DynamoDB key `alias/aws/dynamodb` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-ssespecification.html#cfn-dynamodb-table-ssespecification-kmsmasterkeyid
	//
	KmsMasterKeyId *string `field:"optional" json:"kmsMasterKeyId" yaml:"kmsMasterKeyId"`
	// Server-side encryption type. The only supported value is:.
	//
	// - `KMS` - Server-side encryption that uses AWS Key Management Service . The key is stored in your account and is managed by AWS KMS ( AWS KMS charges apply).
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-ssespecification.html#cfn-dynamodb-table-ssespecification-ssetype
	//
	SseType *string `field:"optional" json:"sseType" yaml:"sseType"`
}

Represents the settings used to enable server-side encryption.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

sSESpecificationProperty := &SSESpecificationProperty{
	SseEnabled: jsii.Boolean(false),

	// the properties below are optional
	KmsMasterKeyId: jsii.String("kmsMasterKeyId"),
	SseType: jsii.String("sseType"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-ssespecification.html

type CfnTable_StreamSpecificationProperty

type CfnTable_StreamSpecificationProperty struct {
	// When an item in the table is modified, `StreamViewType` determines what information is written to the stream for this table.
	//
	// Valid values for `StreamViewType` are:
	//
	// - `KEYS_ONLY` - Only the key attributes of the modified item are written to the stream.
	// - `NEW_IMAGE` - The entire item, as it appears after it was modified, is written to the stream.
	// - `OLD_IMAGE` - The entire item, as it appeared before it was modified, is written to the stream.
	// - `NEW_AND_OLD_IMAGES` - Both the new and the old item images of the item are written to the stream.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-streamspecification.html#cfn-dynamodb-table-streamspecification-streamviewtype
	//
	StreamViewType *string `field:"required" json:"streamViewType" yaml:"streamViewType"`
}

Represents the DynamoDB Streams configuration for a table in DynamoDB.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

streamSpecificationProperty := &StreamSpecificationProperty{
	StreamViewType: jsii.String("streamViewType"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-streamspecification.html

type CfnTable_TimeToLiveSpecificationProperty

type CfnTable_TimeToLiveSpecificationProperty struct {
	// Indicates whether TTL is to be enabled (true) or disabled (false) on the table.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-timetolivespecification.html#cfn-dynamodb-table-timetolivespecification-enabled
	//
	Enabled interface{} `field:"required" json:"enabled" yaml:"enabled"`
	// The name of the TTL attribute used to store the expiration time for items in the table.
	//
	// > - The `AttributeName` property is required when enabling the TTL, or when TTL is already enabled.
	// > - To update this property, you must first disable TTL and then enable TTL with the new attribute name.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-timetolivespecification.html#cfn-dynamodb-table-timetolivespecification-attributename
	//
	AttributeName *string `field:"optional" json:"attributeName" yaml:"attributeName"`
}

Represents the settings used to enable or disable Time to Live (TTL) for the specified table.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

timeToLiveSpecificationProperty := &TimeToLiveSpecificationProperty{
	Enabled: jsii.Boolean(false),

	// the properties below are optional
	AttributeName: jsii.String("attributeName"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-timetolivespecification.html

type CsvOptions added in v2.123.0

type CsvOptions struct {
	// The delimiter used for separating items in the CSV file being imported.
	//
	// Valid delimiters are as follows:
	// - comma (`,`)
	// - tab (`\t`)
	// - colon (`:`)
	// - semicolon (`;`)
	// - pipe (`|`)
	// - space (` `).
	// Default: - use comma as a delimiter.
	//
	Delimiter *string `field:"optional" json:"delimiter" yaml:"delimiter"`
	// List of the headers used to specify a common header for all source CSV files being imported.
	//
	// **NOTE**: If this field is specified then the first line of each CSV file is treated as data instead of the header.
	// If this field is not specified the the first line of each CSV file is treated as the header.
	// Default: - the first line of the CSV file is treated as the header.
	//
	HeaderList *[]*string `field:"optional" json:"headerList" yaml:"headerList"`
}

The options for imported source files in CSV format.

Example:

import "github.com/aws/aws-cdk-go/awscdk"
import s3 "github.com/aws/aws-cdk-go/awscdk"

var bucket iBucket

app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"))

dynamodb.NewTable(stack, jsii.String("Table"), &TableProps{
	PartitionKey: &Attribute{
		Name: jsii.String("id"),
		Type: dynamodb.AttributeType_STRING,
	},
	ImportSource: &ImportSourceSpecification{
		CompressionType: dynamodb.InputCompressionType_GZIP,
		InputFormat: dynamodb.InputFormat_Csv(&CsvOptions{
			Delimiter: jsii.String(","),
			HeaderList: []*string{
				jsii.String("id"),
				jsii.String("name"),
			},
		}),
		Bucket: *Bucket,
		KeyPrefix: jsii.String("prefix"),
	},
})

type EnableScalingProps

type EnableScalingProps struct {
	// Maximum capacity to scale to.
	MaxCapacity *float64 `field:"required" json:"maxCapacity" yaml:"maxCapacity"`
	// Minimum capacity to scale to.
	MinCapacity *float64 `field:"required" json:"minCapacity" yaml:"minCapacity"`
}

Properties for enabling DynamoDB capacity scaling.

Example:

import dynamodb "github.com/aws/aws-cdk-go/awscdk"

var table table

readCapacity := table.AutoScaleReadCapacity(&EnableScalingProps{
	MinCapacity: jsii.Number(10),
	MaxCapacity: jsii.Number(1000),
})
readCapacity.ScaleOnUtilization(&UtilizationScalingProps{
	TargetUtilizationPercent: jsii.Number(60),
})

type GlobalSecondaryIndexProps

type GlobalSecondaryIndexProps struct {
	// The name of the secondary index.
	IndexName *string `field:"required" json:"indexName" yaml:"indexName"`
	// The non-key attributes that are projected into the secondary index.
	// Default: - No additional attributes.
	//
	NonKeyAttributes *[]*string `field:"optional" json:"nonKeyAttributes" yaml:"nonKeyAttributes"`
	// The set of attributes that are projected into the secondary index.
	// Default: ALL.
	//
	ProjectionType ProjectionType `field:"optional" json:"projectionType" yaml:"projectionType"`
	// Partition key attribute definition.
	PartitionKey *Attribute `field:"required" json:"partitionKey" yaml:"partitionKey"`
	// Sort key attribute definition.
	// Default: no sort key.
	//
	SortKey *Attribute `field:"optional" json:"sortKey" yaml:"sortKey"`
	// The read capacity for the global secondary index.
	//
	// Can only be provided if table billingMode is Provisioned or undefined.
	// Default: 5.
	//
	ReadCapacity *float64 `field:"optional" json:"readCapacity" yaml:"readCapacity"`
	// The write capacity for the global secondary index.
	//
	// Can only be provided if table billingMode is Provisioned or undefined.
	// Default: 5.
	//
	WriteCapacity *float64 `field:"optional" json:"writeCapacity" yaml:"writeCapacity"`
}

Properties for a global secondary index.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

globalSecondaryIndexProps := &GlobalSecondaryIndexProps{
	IndexName: jsii.String("indexName"),
	PartitionKey: &Attribute{
		Name: jsii.String("name"),
		Type: awscdk.Aws_dynamodb.AttributeType_BINARY,
	},

	// the properties below are optional
	NonKeyAttributes: []*string{
		jsii.String("nonKeyAttributes"),
	},
	ProjectionType: awscdk.*Aws_dynamodb.ProjectionType_KEYS_ONLY,
	ReadCapacity: jsii.Number(123),
	SortKey: &Attribute{
		Name: jsii.String("name"),
		Type: awscdk.*Aws_dynamodb.AttributeType_BINARY,
	},
	WriteCapacity: jsii.Number(123),
}

type GlobalSecondaryIndexPropsV2 added in v2.95.0

type GlobalSecondaryIndexPropsV2 struct {
	// The name of the secondary index.
	IndexName *string `field:"required" json:"indexName" yaml:"indexName"`
	// The non-key attributes that are projected into the secondary index.
	// Default: - No additional attributes.
	//
	NonKeyAttributes *[]*string `field:"optional" json:"nonKeyAttributes" yaml:"nonKeyAttributes"`
	// The set of attributes that are projected into the secondary index.
	// Default: ALL.
	//
	ProjectionType ProjectionType `field:"optional" json:"projectionType" yaml:"projectionType"`
	// Partition key attribute definition.
	PartitionKey *Attribute `field:"required" json:"partitionKey" yaml:"partitionKey"`
	// The read capacity.
	//
	// Note: This can only be configured if the primary table billing is provisioned.
	// Default: - inherited from the primary table.
	//
	ReadCapacity Capacity `field:"optional" json:"readCapacity" yaml:"readCapacity"`
	// Sort key attribute definition.
	// Default: - no sort key.
	//
	SortKey *Attribute `field:"optional" json:"sortKey" yaml:"sortKey"`
	// The write capacity.
	//
	// Note: This can only be configured if the primary table billing is provisioned.
	// Default: - inherited from the primary table.
	//
	WriteCapacity Capacity `field:"optional" json:"writeCapacity" yaml:"writeCapacity"`
}

Properties used to configure a global secondary index.

Example:

table := dynamodb.NewTableV2(this, jsii.String("Table"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	GlobalSecondaryIndexes: []globalSecondaryIndexPropsV2{
		&globalSecondaryIndexPropsV2{
			IndexName: jsii.String("gsi1"),
			PartitionKey: &Attribute{
				Name: jsii.String("pk"),
				Type: dynamodb.AttributeType_STRING,
			},
		},
	},
})

table.AddGlobalSecondaryIndex(&globalSecondaryIndexPropsV2{
	IndexName: jsii.String("gsi2"),
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
})

type IScalableTableAttribute

type IScalableTableAttribute interface {
	// Add scheduled scaling for this scaling attribute.
	ScaleOnSchedule(id *string, actions *awsapplicationautoscaling.ScalingSchedule)
	// Scale out or in to keep utilization at a given level.
	ScaleOnUtilization(props *UtilizationScalingProps)
}

Interface for scalable attributes.

type ITable

type ITable interface {
	awscdk.IResource
	// Adds an IAM policy statement associated with this table to an IAM principal's policy.
	//
	// If `encryptionKey` is present, appropriate grants to the key needs to be added
	// separately using the `table.encryptionKey.grant*` methods.
	Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant
	// Permits all DynamoDB operations ("dynamodb:*") to an IAM principal.
	//
	// Appropriate grants will also be added to the customer-managed KMS key
	// if one was configured.
	GrantFullAccess(grantee awsiam.IGrantable) awsiam.Grant
	// Permits an IAM principal all data read operations from this table: BatchGetItem, GetRecords, GetShardIterator, Query, GetItem, Scan.
	//
	// Appropriate grants will also be added to the customer-managed KMS key
	// if one was configured.
	GrantReadData(grantee awsiam.IGrantable) awsiam.Grant
	// Permits an IAM principal to all data read/write operations to this table.
	//
	// BatchGetItem, GetRecords, GetShardIterator, Query, GetItem, Scan,
	// BatchWriteItem, PutItem, UpdateItem, DeleteItem
	//
	// Appropriate grants will also be added to the customer-managed KMS key
	// if one was configured.
	GrantReadWriteData(grantee awsiam.IGrantable) awsiam.Grant
	// Adds an IAM policy statement associated with this table's stream to an IAM principal's policy.
	//
	// If `encryptionKey` is present, appropriate grants to the key needs to be added
	// separately using the `table.encryptionKey.grant*` methods.
	GrantStream(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant
	// Permits an IAM principal all stream data read operations for this table's stream: DescribeStream, GetRecords, GetShardIterator, ListStreams.
	//
	// Appropriate grants will also be added to the customer-managed KMS key
	// if one was configured.
	GrantStreamRead(grantee awsiam.IGrantable) awsiam.Grant
	// Permits an IAM Principal to list streams attached to current dynamodb table.
	GrantTableListStreams(grantee awsiam.IGrantable) awsiam.Grant
	// Permits an IAM principal all data write operations to this table: BatchWriteItem, PutItem, UpdateItem, DeleteItem.
	//
	// Appropriate grants will also be added to the customer-managed KMS key
	// if one was configured.
	GrantWriteData(grantee awsiam.IGrantable) awsiam.Grant
	// Metric for the number of Errors executing all Lambdas.
	Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the conditional check failed requests.
	MetricConditionalCheckFailedRequests(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the consumed read capacity units.
	MetricConsumedReadCapacityUnits(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the consumed write capacity units.
	MetricConsumedWriteCapacityUnits(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the successful request latency.
	MetricSuccessfulRequestLatency(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the system errors this table.
	MetricSystemErrorsForOperations(props *SystemErrorsForOperationsMetricOptions) awscloudwatch.IMetric
	// Metric for throttled requests.
	// Deprecated: use `metricThrottledRequestsForOperations`.
	MetricThrottledRequests(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for throttled requests.
	MetricThrottledRequestsForOperations(props *OperationsMetricOptions) awscloudwatch.IMetric
	// Metric for the user errors.
	MetricUserErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Optional KMS encryption key associated with this table.
	EncryptionKey() awskms.IKey
	// Arn of the dynamodb table.
	TableArn() *string
	// Table name of the dynamodb table.
	TableName() *string
	// ARN of the table's stream, if there is one.
	TableStreamArn() *string
}

An interface that represents a DynamoDB Table - either created with the CDK, or an existing one.

func Table_FromTableArn

func Table_FromTableArn(scope constructs.Construct, id *string, tableArn *string) ITable

Creates a Table construct that represents an external table via table arn.

func Table_FromTableAttributes

func Table_FromTableAttributes(scope constructs.Construct, id *string, attrs *TableAttributes) ITable

Creates a Table construct that represents an external table.

func Table_FromTableName

func Table_FromTableName(scope constructs.Construct, id *string, tableName *string) ITable

Creates a Table construct that represents an external table via table name.

type ITableV2 added in v2.95.0

type ITableV2 interface {
	ITable
	// The ID of the table.
	TableId() *string
}

Represents an instance of a DynamoDB table.

func TableV2_FromTableArn added in v2.95.0

func TableV2_FromTableArn(scope constructs.Construct, id *string, tableArn *string) ITableV2

Creates a Table construct that represents an external table via table ARN.

func TableV2_FromTableAttributes added in v2.95.0

func TableV2_FromTableAttributes(scope constructs.Construct, id *string, attrs *TableAttributesV2) ITableV2

Creates a Table construct that represents an external table.

func TableV2_FromTableName added in v2.95.0

func TableV2_FromTableName(scope constructs.Construct, id *string, tableName *string) ITableV2

Creates a Table construct that represents an external table via table name.

type ImportSourceSpecification added in v2.123.0

type ImportSourceSpecification struct {
	// The S3 bucket that is being imported from.
	Bucket awss3.IBucket `field:"required" json:"bucket" yaml:"bucket"`
	// The format of the imported data.
	InputFormat InputFormat `field:"required" json:"inputFormat" yaml:"inputFormat"`
	// The account number of the S3 bucket that is being imported from.
	// Default: - no value.
	//
	BucketOwner *string `field:"optional" json:"bucketOwner" yaml:"bucketOwner"`
	// The compression type of the imported data.
	// Default: InputCompressionType.NONE
	//
	CompressionType InputCompressionType `field:"optional" json:"compressionType" yaml:"compressionType"`
	// The key prefix shared by all S3 Objects that are being imported.
	// Default: - no value.
	//
	KeyPrefix *string `field:"optional" json:"keyPrefix" yaml:"keyPrefix"`
}

Properties for importing data from the S3.

Example:

import "github.com/aws/aws-cdk-go/awscdk"
import s3 "github.com/aws/aws-cdk-go/awscdk"

var bucket iBucket

app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"))

dynamodb.NewTable(stack, jsii.String("Table"), &TableProps{
	PartitionKey: &Attribute{
		Name: jsii.String("id"),
		Type: dynamodb.AttributeType_STRING,
	},
	ImportSource: &ImportSourceSpecification{
		CompressionType: dynamodb.InputCompressionType_GZIP,
		InputFormat: dynamodb.InputFormat_DynamoDBJson(),
		Bucket: *Bucket,
		KeyPrefix: jsii.String("prefix"),
	},
})

type InputCompressionType added in v2.123.0

type InputCompressionType string

Type of compression to use for imported data.

Example:

import "github.com/aws/aws-cdk-go/awscdk"
import s3 "github.com/aws/aws-cdk-go/awscdk"

var bucket iBucket

app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"))

dynamodb.NewTable(stack, jsii.String("Table"), &TableProps{
	PartitionKey: &Attribute{
		Name: jsii.String("id"),
		Type: dynamodb.AttributeType_STRING,
	},
	ImportSource: &ImportSourceSpecification{
		CompressionType: dynamodb.InputCompressionType_GZIP,
		InputFormat: dynamodb.InputFormat_DynamoDBJson(),
		Bucket: *Bucket,
		KeyPrefix: jsii.String("prefix"),
	},
})
const (
	// GZIP compression.
	InputCompressionType_GZIP InputCompressionType = "GZIP"
	// ZSTD compression.
	InputCompressionType_ZSTD InputCompressionType = "ZSTD"
	// No compression.
	InputCompressionType_NONE InputCompressionType = "NONE"
)

type InputFormat added in v2.123.0

type InputFormat interface {
}

The format of the source data.

Example:

import "github.com/aws/aws-cdk-go/awscdk"
import s3 "github.com/aws/aws-cdk-go/awscdk"

var bucket iBucket

app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"))

dynamodb.NewTable(stack, jsii.String("Table"), &TableProps{
	PartitionKey: &Attribute{
		Name: jsii.String("id"),
		Type: dynamodb.AttributeType_STRING,
	},
	ImportSource: &ImportSourceSpecification{
		CompressionType: dynamodb.InputCompressionType_GZIP,
		InputFormat: dynamodb.InputFormat_DynamoDBJson(),
		Bucket: *Bucket,
		KeyPrefix: jsii.String("prefix"),
	},
})

func InputFormat_Csv added in v2.123.0

func InputFormat_Csv(options *CsvOptions) InputFormat

CSV format.

func InputFormat_DynamoDBJson added in v2.123.0

func InputFormat_DynamoDBJson() InputFormat

DynamoDB JSON format.

func InputFormat_Ion added in v2.123.0

func InputFormat_Ion() InputFormat

Amazon Ion format.

type LocalSecondaryIndexProps

type LocalSecondaryIndexProps struct {
	// The name of the secondary index.
	IndexName *string `field:"required" json:"indexName" yaml:"indexName"`
	// The non-key attributes that are projected into the secondary index.
	// Default: - No additional attributes.
	//
	NonKeyAttributes *[]*string `field:"optional" json:"nonKeyAttributes" yaml:"nonKeyAttributes"`
	// The set of attributes that are projected into the secondary index.
	// Default: ALL.
	//
	ProjectionType ProjectionType `field:"optional" json:"projectionType" yaml:"projectionType"`
	// The attribute of a sort key for the local secondary index.
	SortKey *Attribute `field:"required" json:"sortKey" yaml:"sortKey"`
}

Properties for a local secondary index.

Example:

table := dynamodb.NewTableV2(this, jsii.String("Table"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	SortKey: &Attribute{
		Name: jsii.String("sk"),
		Type: dynamodb.AttributeType_NUMBER,
	},
	LocalSecondaryIndexes: []localSecondaryIndexProps{
		&localSecondaryIndexProps{
			IndexName: jsii.String("lsi1"),
			SortKey: &Attribute{
				Name: jsii.String("sk"),
				Type: dynamodb.AttributeType_NUMBER,
			},
		},
	},
})

table.AddLocalSecondaryIndex(&localSecondaryIndexProps{
	IndexName: jsii.String("lsi2"),
	SortKey: &Attribute{
		Name: jsii.String("sk"),
		Type: dynamodb.AttributeType_NUMBER,
	},
})

type Operation

type Operation string

Supported DynamoDB table operations.

const (
	// GetItem.
	Operation_GET_ITEM Operation = "GET_ITEM"
	// BatchGetItem.
	Operation_BATCH_GET_ITEM Operation = "BATCH_GET_ITEM"
	// Scan.
	Operation_SCAN Operation = "SCAN"
	// Query.
	Operation_QUERY Operation = "QUERY"
	// GetRecords.
	Operation_GET_RECORDS Operation = "GET_RECORDS"
	// PutItem.
	Operation_PUT_ITEM Operation = "PUT_ITEM"
	// DeleteItem.
	Operation_DELETE_ITEM Operation = "DELETE_ITEM"
	// UpdateItem.
	Operation_UPDATE_ITEM Operation = "UPDATE_ITEM"
	// BatchWriteItem.
	Operation_BATCH_WRITE_ITEM Operation = "BATCH_WRITE_ITEM"
	// TransactWriteItems.
	Operation_TRANSACT_WRITE_ITEMS Operation = "TRANSACT_WRITE_ITEMS"
	// TransactGetItems.
	Operation_TRANSACT_GET_ITEMS Operation = "TRANSACT_GET_ITEMS"
	// ExecuteTransaction.
	Operation_EXECUTE_TRANSACTION Operation = "EXECUTE_TRANSACTION"
	// BatchExecuteStatement.
	Operation_BATCH_EXECUTE_STATEMENT Operation = "BATCH_EXECUTE_STATEMENT"
	// ExecuteStatement.
	Operation_EXECUTE_STATEMENT Operation = "EXECUTE_STATEMENT"
)

type OperationsMetricOptions added in v2.44.0

type OperationsMetricOptions struct {
	// Account which this metric comes from.
	// Default: - Deployment account.
	//
	Account *string `field:"optional" json:"account" yaml:"account"`
	// The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The `Color` class has a set of standard colors that can be used here.
	// Default: - Automatic color.
	//
	Color *string `field:"optional" json:"color" yaml:"color"`
	// Dimensions of the metric.
	// Default: - No dimensions.
	//
	DimensionsMap *map[string]*string `field:"optional" json:"dimensionsMap" yaml:"dimensionsMap"`
	// Label for this metric when added to a Graph in a Dashboard.
	//
	// You can use [dynamic labels](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html)
	// to show summary information about the entire displayed time series
	// in the legend. For example, if you use:
	//
	// “`
	// [max: ${MAX}] MyMetric
	// “`
	//
	// As the metric label, the maximum value in the visible range will
	// be shown next to the time series name in the graph's legend.
	// Default: - No label.
	//
	Label *string `field:"optional" json:"label" yaml:"label"`
	// The period over which the specified statistic is applied.
	// Default: Duration.minutes(5)
	//
	Period awscdk.Duration `field:"optional" json:"period" yaml:"period"`
	// Region which this metric comes from.
	// Default: - Deployment region.
	//
	Region *string `field:"optional" json:"region" yaml:"region"`
	// What function to use for aggregating.
	//
	// Use the `aws_cloudwatch.Stats` helper class to construct valid input strings.
	//
	// Can be one of the following:
	//
	// - "Minimum" | "min"
	// - "Maximum" | "max"
	// - "Average" | "avg"
	// - "Sum" | "sum"
	// - "SampleCount | "n"
	// - "pNN.NN"
	// - "tmNN.NN" | "tm(NN.NN%:NN.NN%)"
	// - "iqm"
	// - "wmNN.NN" | "wm(NN.NN%:NN.NN%)"
	// - "tcNN.NN" | "tc(NN.NN%:NN.NN%)"
	// - "tsNN.NN" | "ts(NN.NN%:NN.NN%)"
	// Default: Average.
	//
	Statistic *string `field:"optional" json:"statistic" yaml:"statistic"`
	// Unit used to filter the metric stream.
	//
	// Only refer to datums emitted to the metric stream with the given unit and
	// ignore all others. Only useful when datums are being emitted to the same
	// metric stream under different units.
	//
	// The default is to use all matric datums in the stream, regardless of unit,
	// which is recommended in nearly all cases.
	//
	// CloudWatch does not honor this property for graphs.
	// Default: - All metric datums in the given metric stream.
	//
	Unit awscloudwatch.Unit `field:"optional" json:"unit" yaml:"unit"`
	// The operations to apply the metric to.
	// Default: - All operations available by DynamoDB tables will be considered.
	//
	Operations *[]Operation `field:"optional" json:"operations" yaml:"operations"`
}

Options for configuring metrics that considers multiple operations.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

operationsMetricOptions := &OperationsMetricOptions{
	Account: jsii.String("account"),
	Color: jsii.String("color"),
	DimensionsMap: map[string]*string{
		"dimensionsMapKey": jsii.String("dimensionsMap"),
	},
	Label: jsii.String("label"),
	Operations: []operation{
		awscdk.Aws_dynamodb.*operation_GET_ITEM,
	},
	Period: cdk.Duration_Minutes(jsii.Number(30)),
	Region: jsii.String("region"),
	Statistic: jsii.String("statistic"),
	Unit: awscdk.Aws_cloudwatch.Unit_SECONDS,
}

type ProjectionType

type ProjectionType string

The set of attributes that are projected into the index. See: https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Projection.html

const (
	// Only the index and primary keys are projected into the index.
	ProjectionType_KEYS_ONLY ProjectionType = "KEYS_ONLY"
	// Only the specified table attributes are projected into the index.
	//
	// The list
	// of projected attributes is in `nonKeyAttributes`.
	ProjectionType_INCLUDE ProjectionType = "INCLUDE"
	// All of the table attributes are projected into the index.
	ProjectionType_ALL ProjectionType = "ALL"
)

type ReplicaGlobalSecondaryIndexOptions added in v2.95.0

type ReplicaGlobalSecondaryIndexOptions struct {
	// Whether CloudWatch contributor insights is enabled for a specific global secondary index on a replica table.
	// Default: - inherited from the primary table.
	//
	ContributorInsights *bool `field:"optional" json:"contributorInsights" yaml:"contributorInsights"`
	// The read capacity for a specific global secondary index on a replica table.
	//
	// Note: This can only be configured if primary table billing is provisioned.
	// Default: - inherited from the primary table.
	//
	ReadCapacity Capacity `field:"optional" json:"readCapacity" yaml:"readCapacity"`
}

Options used to configure global secondary indexes on a replica table.

Example:

import "github.com/aws/aws-cdk-go/awscdk"

app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"), &StackProps{
	Env: &Environment{
		Region: jsii.String("us-west-2"),
	},
})

globalTable := dynamodb.NewTableV2(stack, jsii.String("GlobalTable"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	ContributorInsights: jsii.Boolean(true),
	Billing: dynamodb.Billing_Provisioned(&ThroughputProps{
		ReadCapacity: dynamodb.Capacity_Fixed(jsii.Number(10)),
		WriteCapacity: dynamodb.Capacity_Autoscaled(&AutoscaledCapacityOptions{
			MaxCapacity: jsii.Number(10),
		}),
	}),
	// each global secondary index will inherit contributor insights as true
	GlobalSecondaryIndexes: []globalSecondaryIndexPropsV2{
		&globalSecondaryIndexPropsV2{
			IndexName: jsii.String("gsi1"),
			PartitionKey: &Attribute{
				Name: jsii.String("pk"),
				Type: dynamodb.AttributeType_STRING,
			},
			ReadCapacity: dynamodb.Capacity_*Fixed(jsii.Number(15)),
		},
		&globalSecondaryIndexPropsV2{
			IndexName: jsii.String("gsi2"),
			PartitionKey: &Attribute{
				Name: jsii.String("pk"),
				Type: dynamodb.AttributeType_STRING,
			},
			WriteCapacity: dynamodb.Capacity_*Autoscaled(&AutoscaledCapacityOptions{
				MinCapacity: jsii.Number(5),
				MaxCapacity: jsii.Number(20),
			}),
		},
	},
	Replicas: []replicaTableProps{
		&replicaTableProps{
			Region: jsii.String("us-east-1"),
			GlobalSecondaryIndexOptions: map[string]replicaGlobalSecondaryIndexOptions{
				"gsi1": &replicaGlobalSecondaryIndexOptions{
					"readCapacity": dynamodb.Capacity_*Autoscaled(&AutoscaledCapacityOptions{
						"minCapacity": jsii.Number(1),
						"maxCapacity": jsii.Number(10),
					}),
				},
			},
		},
		&replicaTableProps{
			Region: jsii.String("us-east-2"),
			GlobalSecondaryIndexOptions: map[string]*replicaGlobalSecondaryIndexOptions{
				"gsi2": &replicaGlobalSecondaryIndexOptions{
					"contributorInsights": jsii.Boolean(false),
				},
			},
		},
	},
})

type ReplicaTableProps added in v2.95.0

type ReplicaTableProps struct {
	// Whether CloudWatch contributor insights is enabled.
	// Default: false.
	//
	ContributorInsights *bool `field:"optional" json:"contributorInsights" yaml:"contributorInsights"`
	// Whether deletion protection is enabled.
	// Default: false.
	//
	DeletionProtection *bool `field:"optional" json:"deletionProtection" yaml:"deletionProtection"`
	// Kinesis Data Stream to capture item level changes.
	// Default: - no Kinesis Data Stream.
	//
	KinesisStream awskinesis.IStream `field:"optional" json:"kinesisStream" yaml:"kinesisStream"`
	// Whether point-in-time recovery is enabled.
	// Default: false.
	//
	PointInTimeRecovery *bool `field:"optional" json:"pointInTimeRecovery" yaml:"pointInTimeRecovery"`
	// The table class.
	// Default: TableClass.STANDARD
	//
	TableClass TableClass `field:"optional" json:"tableClass" yaml:"tableClass"`
	// Tags to be applied to the table or replica table.
	// Default: - no tags.
	//
	Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"`
	// The region that the replica table will be created in.
	Region *string `field:"required" json:"region" yaml:"region"`
	// Options used to configure global secondary index properties.
	// Default: - inherited from the primary table.
	//
	GlobalSecondaryIndexOptions *map[string]*ReplicaGlobalSecondaryIndexOptions `field:"optional" json:"globalSecondaryIndexOptions" yaml:"globalSecondaryIndexOptions"`
	// The read capacity.
	//
	// Note: This can only be configured if the primary table billing is provisioned.
	// Default: - inherited from the primary table.
	//
	ReadCapacity Capacity `field:"optional" json:"readCapacity" yaml:"readCapacity"`
}

Properties used to configure a replica table.

Example:

import "github.com/aws/aws-cdk-go/awscdk"

app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"), &StackProps{
	Env: &Environment{
		Region: jsii.String("us-west-2"),
	},
})

globalTable := dynamodb.NewTableV2(stack, jsii.String("GlobalTable"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	Replicas: []replicaTableProps{
		&replicaTableProps{
			Region: jsii.String("us-east-1"),
		},
	},
})

globalTable.AddReplica(&replicaTableProps{
	Region: jsii.String("us-east-2"),
	DeletionProtection: jsii.Boolean(true),
})

type SchemaOptions

type SchemaOptions struct {
	// Partition key attribute definition.
	PartitionKey *Attribute `field:"required" json:"partitionKey" yaml:"partitionKey"`
	// Sort key attribute definition.
	// Default: no sort key.
	//
	SortKey *Attribute `field:"optional" json:"sortKey" yaml:"sortKey"`
}

Represents the table schema attributes.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

schemaOptions := &SchemaOptions{
	PartitionKey: &Attribute{
		Name: jsii.String("name"),
		Type: awscdk.Aws_dynamodb.AttributeType_BINARY,
	},

	// the properties below are optional
	SortKey: &Attribute{
		Name: jsii.String("name"),
		Type: awscdk.*Aws_dynamodb.AttributeType_BINARY,
	},
}

type SecondaryIndexProps

type SecondaryIndexProps struct {
	// The name of the secondary index.
	IndexName *string `field:"required" json:"indexName" yaml:"indexName"`
	// The non-key attributes that are projected into the secondary index.
	// Default: - No additional attributes.
	//
	NonKeyAttributes *[]*string `field:"optional" json:"nonKeyAttributes" yaml:"nonKeyAttributes"`
	// The set of attributes that are projected into the secondary index.
	// Default: ALL.
	//
	ProjectionType ProjectionType `field:"optional" json:"projectionType" yaml:"projectionType"`
}

Properties for a secondary index.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

secondaryIndexProps := &SecondaryIndexProps{
	IndexName: jsii.String("indexName"),

	// the properties below are optional
	NonKeyAttributes: []*string{
		jsii.String("nonKeyAttributes"),
	},
	ProjectionType: awscdk.Aws_dynamodb.ProjectionType_KEYS_ONLY,
}

type StreamViewType

type StreamViewType string

When an item in the table is modified, StreamViewType determines what information is written to the stream for this table.

Example:

import "github.com/aws/aws-cdk-go/awscdk"
import kinesis "github.com/aws/aws-cdk-go/awscdk"

app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"), &StackProps{
	Env: &Environment{
		Region: jsii.String("us-west-2"),
	},
})

globalTable := dynamodb.NewTableV2(this, jsii.String("GlobalTable"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("id"),
		Type: dynamodb.AttributeType_STRING,
	},
	DynamoStream: dynamodb.StreamViewType_OLD_IMAGE,
	// tables in us-west-2, us-east-1, and us-east-2 all have dynamo stream type of OLD_IMAGES
	Replicas: []replicaTableProps{
		&replicaTableProps{
			Region: jsii.String("us-east-1"),
		},
		&replicaTableProps{
			Region: jsii.String("us-east-2"),
		},
	},
})

See: https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_StreamSpecification.html

const (
	// The entire item, as it appears after it was modified, is written to the stream.
	StreamViewType_NEW_IMAGE StreamViewType = "NEW_IMAGE"
	// The entire item, as it appeared before it was modified, is written to the stream.
	StreamViewType_OLD_IMAGE StreamViewType = "OLD_IMAGE"
	// Both the new and the old item images of the item are written to the stream.
	StreamViewType_NEW_AND_OLD_IMAGES StreamViewType = "NEW_AND_OLD_IMAGES"
	// Only the key attributes of the modified item are written to the stream.
	StreamViewType_KEYS_ONLY StreamViewType = "KEYS_ONLY"
)

type SystemErrorsForOperationsMetricOptions

type SystemErrorsForOperationsMetricOptions struct {
	// Account which this metric comes from.
	// Default: - Deployment account.
	//
	Account *string `field:"optional" json:"account" yaml:"account"`
	// The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The `Color` class has a set of standard colors that can be used here.
	// Default: - Automatic color.
	//
	Color *string `field:"optional" json:"color" yaml:"color"`
	// Dimensions of the metric.
	// Default: - No dimensions.
	//
	DimensionsMap *map[string]*string `field:"optional" json:"dimensionsMap" yaml:"dimensionsMap"`
	// Label for this metric when added to a Graph in a Dashboard.
	//
	// You can use [dynamic labels](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html)
	// to show summary information about the entire displayed time series
	// in the legend. For example, if you use:
	//
	// “`
	// [max: ${MAX}] MyMetric
	// “`
	//
	// As the metric label, the maximum value in the visible range will
	// be shown next to the time series name in the graph's legend.
	// Default: - No label.
	//
	Label *string `field:"optional" json:"label" yaml:"label"`
	// The period over which the specified statistic is applied.
	// Default: Duration.minutes(5)
	//
	Period awscdk.Duration `field:"optional" json:"period" yaml:"period"`
	// Region which this metric comes from.
	// Default: - Deployment region.
	//
	Region *string `field:"optional" json:"region" yaml:"region"`
	// What function to use for aggregating.
	//
	// Use the `aws_cloudwatch.Stats` helper class to construct valid input strings.
	//
	// Can be one of the following:
	//
	// - "Minimum" | "min"
	// - "Maximum" | "max"
	// - "Average" | "avg"
	// - "Sum" | "sum"
	// - "SampleCount | "n"
	// - "pNN.NN"
	// - "tmNN.NN" | "tm(NN.NN%:NN.NN%)"
	// - "iqm"
	// - "wmNN.NN" | "wm(NN.NN%:NN.NN%)"
	// - "tcNN.NN" | "tc(NN.NN%:NN.NN%)"
	// - "tsNN.NN" | "ts(NN.NN%:NN.NN%)"
	// Default: Average.
	//
	Statistic *string `field:"optional" json:"statistic" yaml:"statistic"`
	// Unit used to filter the metric stream.
	//
	// Only refer to datums emitted to the metric stream with the given unit and
	// ignore all others. Only useful when datums are being emitted to the same
	// metric stream under different units.
	//
	// The default is to use all matric datums in the stream, regardless of unit,
	// which is recommended in nearly all cases.
	//
	// CloudWatch does not honor this property for graphs.
	// Default: - All metric datums in the given metric stream.
	//
	Unit awscloudwatch.Unit `field:"optional" json:"unit" yaml:"unit"`
	// The operations to apply the metric to.
	// Default: - All operations available by DynamoDB tables will be considered.
	//
	Operations *[]Operation `field:"optional" json:"operations" yaml:"operations"`
}

Options for configuring a system errors metric that considers multiple operations.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

systemErrorsForOperationsMetricOptions := &SystemErrorsForOperationsMetricOptions{
	Account: jsii.String("account"),
	Color: jsii.String("color"),
	DimensionsMap: map[string]*string{
		"dimensionsMapKey": jsii.String("dimensionsMap"),
	},
	Label: jsii.String("label"),
	Operations: []operation{
		awscdk.Aws_dynamodb.*operation_GET_ITEM,
	},
	Period: cdk.Duration_Minutes(jsii.Number(30)),
	Region: jsii.String("region"),
	Statistic: jsii.String("statistic"),
	Unit: awscdk.Aws_cloudwatch.Unit_SECONDS,
}

type Table

type Table interface {
	TableBase
	// KMS encryption key, if this table uses a customer-managed encryption key.
	EncryptionKey() awskms.IKey
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	Env() *awscdk.ResourceEnvironment
	// Whether this table has indexes.
	HasIndex() *bool
	// The tree node.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	PhysicalName() *string
	RegionalArns() *[]*string
	// The stack in which this resource is defined.
	Stack() awscdk.Stack
	// Arn of the dynamodb table.
	TableArn() *string
	// Table name of the dynamodb table.
	TableName() *string
	// ARN of the table's stream, if there is one.
	TableStreamArn() *string
	// Add a global secondary index of table.
	AddGlobalSecondaryIndex(props *GlobalSecondaryIndexProps)
	// Add a local secondary index of table.
	AddLocalSecondaryIndex(props *LocalSecondaryIndexProps)
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Enable read capacity scaling for the given GSI.
	//
	// Returns: An object to configure additional AutoScaling settings for this attribute.
	AutoScaleGlobalSecondaryIndexReadCapacity(indexName *string, props *EnableScalingProps) IScalableTableAttribute
	// Enable write capacity scaling for the given GSI.
	//
	// Returns: An object to configure additional AutoScaling settings for this attribute.
	AutoScaleGlobalSecondaryIndexWriteCapacity(indexName *string, props *EnableScalingProps) IScalableTableAttribute
	// Enable read capacity scaling for this table.
	//
	// Returns: An object to configure additional AutoScaling settings.
	AutoScaleReadCapacity(props *EnableScalingProps) IScalableTableAttribute
	// Enable write capacity scaling for this table.
	//
	// Returns: An object to configure additional AutoScaling settings for this attribute.
	AutoScaleWriteCapacity(props *EnableScalingProps) IScalableTableAttribute
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	GetResourceNameAttribute(nameAttr *string) *string
	// Adds an IAM policy statement associated with this table to an IAM principal's policy.
	//
	// If `encryptionKey` is present, appropriate grants to the key needs to be added
	// separately using the `table.encryptionKey.grant*` methods.
	Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant
	// Permits all DynamoDB operations ("dynamodb:*") to an IAM principal.
	//
	// Appropriate grants will also be added to the customer-managed KMS key
	// if one was configured.
	GrantFullAccess(grantee awsiam.IGrantable) awsiam.Grant
	// Permits an IAM principal all data read operations from this table: BatchGetItem, GetRecords, GetShardIterator, Query, GetItem, Scan, DescribeTable.
	//
	// Appropriate grants will also be added to the customer-managed KMS key
	// if one was configured.
	GrantReadData(grantee awsiam.IGrantable) awsiam.Grant
	// Permits an IAM principal to all data read/write operations to this table.
	//
	// BatchGetItem, GetRecords, GetShardIterator, Query, GetItem, Scan,
	// BatchWriteItem, PutItem, UpdateItem, DeleteItem, DescribeTable
	//
	// Appropriate grants will also be added to the customer-managed KMS key
	// if one was configured.
	GrantReadWriteData(grantee awsiam.IGrantable) awsiam.Grant
	// Adds an IAM policy statement associated with this table's stream to an IAM principal's policy.
	//
	// If `encryptionKey` is present, appropriate grants to the key needs to be added
	// separately using the `table.encryptionKey.grant*` methods.
	GrantStream(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant
	// Permits an IAM principal all stream data read operations for this table's stream: DescribeStream, GetRecords, GetShardIterator, ListStreams.
	//
	// Appropriate grants will also be added to the customer-managed KMS key
	// if one was configured.
	GrantStreamRead(grantee awsiam.IGrantable) awsiam.Grant
	// Permits an IAM Principal to list streams attached to current dynamodb table.
	GrantTableListStreams(grantee awsiam.IGrantable) awsiam.Grant
	// Permits an IAM principal all data write operations to this table: BatchWriteItem, PutItem, UpdateItem, DeleteItem, DescribeTable.
	//
	// Appropriate grants will also be added to the customer-managed KMS key
	// if one was configured.
	GrantWriteData(grantee awsiam.IGrantable) awsiam.Grant
	// Return the given named metric for this Table.
	//
	// By default, the metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the conditional check failed requests this table.
	//
	// By default, the metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	MetricConditionalCheckFailedRequests(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the consumed read capacity units this table.
	//
	// By default, the metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	MetricConsumedReadCapacityUnits(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the consumed write capacity units this table.
	//
	// By default, the metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	MetricConsumedWriteCapacityUnits(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the successful request latency this table.
	//
	// By default, the metric will be calculated as an average over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	MetricSuccessfulRequestLatency(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the system errors this table.
	// Deprecated: use `metricSystemErrorsForOperations`.
	MetricSystemErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the system errors this table.
	//
	// This will sum errors across all possible operations.
	// Note that by default, each individual metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	MetricSystemErrorsForOperations(props *SystemErrorsForOperationsMetricOptions) awscloudwatch.IMetric
	// How many requests are throttled on this table.
	//
	// Default: sum over 5 minutes.
	// Deprecated: Do not use this function. It returns an invalid metric. Use `metricThrottledRequestsForOperation` instead.
	MetricThrottledRequests(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// How many requests are throttled on this table, for the given operation.
	//
	// Default: sum over 5 minutes.
	MetricThrottledRequestsForOperation(operation *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// How many requests are throttled on this table.
	//
	// This will sum errors across all possible operations.
	// Note that by default, each individual metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	MetricThrottledRequestsForOperations(props *OperationsMetricOptions) awscloudwatch.IMetric
	// Metric for the user errors.
	//
	// Note that this metric reports user errors across all
	// the tables in the account and region the table resides in.
	//
	// By default, the metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	MetricUserErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Get schema attributes of table or index.
	//
	// Returns: Schema of table or index.
	Schema(indexName *string) *SchemaOptions
	// Returns a string representation of this construct.
	ToString() *string
}

Provides a DynamoDB table.

Example:

import "github.com/aws/aws-cdk-go/awscdk"
import s3 "github.com/aws/aws-cdk-go/awscdk"

var bucket iBucket

app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"))

dynamodb.NewTable(stack, jsii.String("Table"), &TableProps{
	PartitionKey: &Attribute{
		Name: jsii.String("id"),
		Type: dynamodb.AttributeType_STRING,
	},
	ImportSource: &ImportSourceSpecification{
		CompressionType: dynamodb.InputCompressionType_GZIP,
		InputFormat: dynamodb.InputFormat_Csv(&CsvOptions{
			Delimiter: jsii.String(","),
			HeaderList: []*string{
				jsii.String("id"),
				jsii.String("name"),
			},
		}),
		Bucket: *Bucket,
		KeyPrefix: jsii.String("prefix"),
	},
})

func NewTable

func NewTable(scope constructs.Construct, id *string, props *TableProps) Table

type TableAttributes

type TableAttributes struct {
	// KMS encryption key, if this table uses a customer-managed encryption key.
	// Default: - no key.
	//
	EncryptionKey awskms.IKey `field:"optional" json:"encryptionKey" yaml:"encryptionKey"`
	// The name of the global indexes set for this Table.
	//
	// Note that you need to set either this property,
	// or `localIndexes`,
	// if you want methods like grantReadData()
	// to grant permissions for indexes as well as the table itself.
	// Default: - no global indexes.
	//
	GlobalIndexes *[]*string `field:"optional" json:"globalIndexes" yaml:"globalIndexes"`
	// If set to true, grant methods always grant permissions for all indexes.
	//
	// If false is provided, grant methods grant the permissions
	// only when `globalIndexes` or `localIndexes` is specified.
	// Default: - false.
	//
	GrantIndexPermissions *bool `field:"optional" json:"grantIndexPermissions" yaml:"grantIndexPermissions"`
	// The name of the local indexes set for this Table.
	//
	// Note that you need to set either this property,
	// or `globalIndexes`,
	// if you want methods like grantReadData()
	// to grant permissions for indexes as well as the table itself.
	// Default: - no local indexes.
	//
	LocalIndexes *[]*string `field:"optional" json:"localIndexes" yaml:"localIndexes"`
	// The ARN of the dynamodb table.
	//
	// One of this, or `tableName`, is required.
	// Default: - no table arn.
	//
	TableArn *string `field:"optional" json:"tableArn" yaml:"tableArn"`
	// The table name of the dynamodb table.
	//
	// One of this, or `tableArn`, is required.
	// Default: - no table name.
	//
	TableName *string `field:"optional" json:"tableName" yaml:"tableName"`
	// The ARN of the table's stream.
	// Default: - no table stream.
	//
	TableStreamArn *string `field:"optional" json:"tableStreamArn" yaml:"tableStreamArn"`
}

Reference to a dynamodb table.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var key key

tableAttributes := &TableAttributes{
	EncryptionKey: key,
	GlobalIndexes: []*string{
		jsii.String("globalIndexes"),
	},
	GrantIndexPermissions: jsii.Boolean(false),
	LocalIndexes: []*string{
		jsii.String("localIndexes"),
	},
	TableArn: jsii.String("tableArn"),
	TableName: jsii.String("tableName"),
	TableStreamArn: jsii.String("tableStreamArn"),
}

type TableAttributesV2 added in v2.95.0

type TableAttributesV2 struct {
	// KMS encryption key for the table.
	// Default: - no KMS encryption key.
	//
	EncryptionKey awskms.IKey `field:"optional" json:"encryptionKey" yaml:"encryptionKey"`
	// The name of the global indexes set for the table.
	//
	// Note: You must set either this property or `localIndexes` if you want permissions
	// to be granted for indexes as well as the table itself.
	// Default: - no global indexes.
	//
	GlobalIndexes *[]*string `field:"optional" json:"globalIndexes" yaml:"globalIndexes"`
	// Whether or not to grant permissions for all indexes of the table.
	//
	// Note: If false, permissions will only be granted to indexes when `globalIndexes`
	// or `localIndexes` is specified.
	// Default: false.
	//
	GrantIndexPermissions *bool `field:"optional" json:"grantIndexPermissions" yaml:"grantIndexPermissions"`
	// The name of the local indexes set for the table.
	//
	// Note: You must set either this property or `globalIndexes` if you want permissions
	// to be granted for indexes as well as the table itself.
	// Default: - no local indexes.
	//
	LocalIndexes *[]*string `field:"optional" json:"localIndexes" yaml:"localIndexes"`
	// The ARN of the table.
	//
	// Note: You must specify this or the `tableName`.
	// Default: - table arn generated using `tableName` and region of stack.
	//
	TableArn *string `field:"optional" json:"tableArn" yaml:"tableArn"`
	// The ID of the table.
	// Default: - no table id.
	//
	TableId *string `field:"optional" json:"tableId" yaml:"tableId"`
	// The name of the table.
	//
	// Note: You must specify this or the `tableArn`.
	// Default: - table name retrieved from provided `tableArn`.
	//
	TableName *string `field:"optional" json:"tableName" yaml:"tableName"`
	// The stream ARN of the table.
	// Default: - no table stream ARN.
	//
	TableStreamArn *string `field:"optional" json:"tableStreamArn" yaml:"tableStreamArn"`
}

Attributes of a DynamoDB table.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var key key

tableAttributesV2 := &TableAttributesV2{
	EncryptionKey: key,
	GlobalIndexes: []*string{
		jsii.String("globalIndexes"),
	},
	GrantIndexPermissions: jsii.Boolean(false),
	LocalIndexes: []*string{
		jsii.String("localIndexes"),
	},
	TableArn: jsii.String("tableArn"),
	TableId: jsii.String("tableId"),
	TableName: jsii.String("tableName"),
	TableStreamArn: jsii.String("tableStreamArn"),
}

type TableBase added in v2.95.0

type TableBase interface {
	awscdk.Resource
	ITable
	// KMS encryption key, if this table uses a customer-managed encryption key.
	EncryptionKey() awskms.IKey
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	Env() *awscdk.ResourceEnvironment
	HasIndex() *bool
	// The tree node.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	PhysicalName() *string
	RegionalArns() *[]*string
	// The stack in which this resource is defined.
	Stack() awscdk.Stack
	// Arn of the dynamodb table.
	TableArn() *string
	// Table name of the dynamodb table.
	TableName() *string
	// ARN of the table's stream, if there is one.
	TableStreamArn() *string
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	GetResourceNameAttribute(nameAttr *string) *string
	// Adds an IAM policy statement associated with this table to an IAM principal's policy.
	//
	// If `encryptionKey` is present, appropriate grants to the key needs to be added
	// separately using the `table.encryptionKey.grant*` methods.
	Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant
	// Permits all DynamoDB operations ("dynamodb:*") to an IAM principal.
	//
	// Appropriate grants will also be added to the customer-managed KMS key
	// if one was configured.
	GrantFullAccess(grantee awsiam.IGrantable) awsiam.Grant
	// Permits an IAM principal all data read operations from this table: BatchGetItem, GetRecords, GetShardIterator, Query, GetItem, Scan, DescribeTable.
	//
	// Appropriate grants will also be added to the customer-managed KMS key
	// if one was configured.
	GrantReadData(grantee awsiam.IGrantable) awsiam.Grant
	// Permits an IAM principal to all data read/write operations to this table.
	//
	// BatchGetItem, GetRecords, GetShardIterator, Query, GetItem, Scan,
	// BatchWriteItem, PutItem, UpdateItem, DeleteItem, DescribeTable
	//
	// Appropriate grants will also be added to the customer-managed KMS key
	// if one was configured.
	GrantReadWriteData(grantee awsiam.IGrantable) awsiam.Grant
	// Adds an IAM policy statement associated with this table's stream to an IAM principal's policy.
	//
	// If `encryptionKey` is present, appropriate grants to the key needs to be added
	// separately using the `table.encryptionKey.grant*` methods.
	GrantStream(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant
	// Permits an IAM principal all stream data read operations for this table's stream: DescribeStream, GetRecords, GetShardIterator, ListStreams.
	//
	// Appropriate grants will also be added to the customer-managed KMS key
	// if one was configured.
	GrantStreamRead(grantee awsiam.IGrantable) awsiam.Grant
	// Permits an IAM Principal to list streams attached to current dynamodb table.
	GrantTableListStreams(grantee awsiam.IGrantable) awsiam.Grant
	// Permits an IAM principal all data write operations to this table: BatchWriteItem, PutItem, UpdateItem, DeleteItem, DescribeTable.
	//
	// Appropriate grants will also be added to the customer-managed KMS key
	// if one was configured.
	GrantWriteData(grantee awsiam.IGrantable) awsiam.Grant
	// Return the given named metric for this Table.
	//
	// By default, the metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the conditional check failed requests this table.
	//
	// By default, the metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	MetricConditionalCheckFailedRequests(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the consumed read capacity units this table.
	//
	// By default, the metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	MetricConsumedReadCapacityUnits(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the consumed write capacity units this table.
	//
	// By default, the metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	MetricConsumedWriteCapacityUnits(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the successful request latency this table.
	//
	// By default, the metric will be calculated as an average over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	MetricSuccessfulRequestLatency(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the system errors this table.
	// Deprecated: use `metricSystemErrorsForOperations`.
	MetricSystemErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the system errors this table.
	//
	// This will sum errors across all possible operations.
	// Note that by default, each individual metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	MetricSystemErrorsForOperations(props *SystemErrorsForOperationsMetricOptions) awscloudwatch.IMetric
	// How many requests are throttled on this table.
	//
	// Default: sum over 5 minutes.
	// Deprecated: Do not use this function. It returns an invalid metric. Use `metricThrottledRequestsForOperation` instead.
	MetricThrottledRequests(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// How many requests are throttled on this table, for the given operation.
	//
	// Default: sum over 5 minutes.
	MetricThrottledRequestsForOperation(operation *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// How many requests are throttled on this table.
	//
	// This will sum errors across all possible operations.
	// Note that by default, each individual metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	MetricThrottledRequestsForOperations(props *OperationsMetricOptions) awscloudwatch.IMetric
	// Metric for the user errors.
	//
	// Note that this metric reports user errors across all
	// the tables in the account and region the table resides in.
	//
	// By default, the metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	MetricUserErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Returns a string representation of this construct.
	ToString() *string
}

type TableBaseV2 added in v2.95.0

type TableBaseV2 interface {
	awscdk.Resource
	ITableV2
	// The KMS encryption key for the table.
	EncryptionKey() awskms.IKey
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	Env() *awscdk.ResourceEnvironment
	HasIndex() *bool
	// The tree node.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	PhysicalName() *string
	Region() *string
	// The stack in which this resource is defined.
	Stack() awscdk.Stack
	// The ARN of the table.
	TableArn() *string
	// The ID of the table.
	TableId() *string
	// The name of the table.
	TableName() *string
	// The stream ARN of the table.
	TableStreamArn() *string
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	GetResourceNameAttribute(nameAttr *string) *string
	// Adds an IAM policy statement associated with this table to an IAM principal's policy.
	//
	// Note: If `encryptionKey` is present, appropriate grants to the key needs to be added
	// separately using the `table.encryptionKey.grant*` methods.
	Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant
	// Permits an IAM principal to all DynamoDB operations ('dynamodb:*') on this table.
	//
	// Note: Appropriate grants will also be added to the customer-managed KMS keys associated with this
	// table if one was configured.
	GrantFullAccess(grantee awsiam.IGrantable) awsiam.Grant
	// Permits an IAM principal all data read operations on this table.
	//
	// Actions: BatchGetItem, GetRecords, GetShardIterator, Query, GetItem, Scan, DescribeTable.
	//
	// Note: Appropriate grants will also be added to the customer-managed KMS keys associated with this
	// table if one was configured.
	GrantReadData(grantee awsiam.IGrantable) awsiam.Grant
	// Permits an IAM principal to all data read/write operations on this table.
	//
	// Actions: BatchGetItem, GetRecords, GetShardIterator, Query, GetItem, Scan, BatchWriteItem, PutItem, UpdateItem,
	// DeleteItem, DescribeTable.
	//
	// Note: Appropriate grants will also be added to the customer-managed KMS keys associated with this
	// table if one was configured.
	GrantReadWriteData(grantee awsiam.IGrantable) awsiam.Grant
	// Adds an IAM policy statement associated with this table to an IAM principal's policy.
	//
	// Note: If `encryptionKey` is present, appropriate grants to the key needs to be added
	// separately using the `table.encryptionKey.grant*` methods.
	GrantStream(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant
	// Adds an IAM policy statement associated with this table to an IAM principal's policy.
	//
	// Actions: DescribeStream, GetRecords, GetShardIterator, ListStreams.
	//
	// Note: Appropriate grants will also be added to the customer-managed KMS keys associated with this
	// table if one was configured.
	GrantStreamRead(grantee awsiam.IGrantable) awsiam.Grant
	// Permits an IAM principal to list streams attached to this table.
	GrantTableListStreams(grantee awsiam.IGrantable) awsiam.Grant
	// Permits an IAM principal all data write operations on this table.
	//
	// Actions: BatchWriteItem, PutItem, UpdateItem, DeleteItem, DescribeTable.
	//
	// Note: Appropriate grants will also be added to the customer-managed KMS keys associated with this
	// table if one was configured.
	GrantWriteData(grantee awsiam.IGrantable) awsiam.Grant
	// Return the given named metric for this table.
	//
	// By default, the metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the conditional check failed requests for this table.
	//
	// By default, the metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	MetricConditionalCheckFailedRequests(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the consumed read capacity units for this table.
	//
	// By default, the metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	MetricConsumedReadCapacityUnits(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the consumed write capacity units for this table.
	//
	// By default, the metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	MetricConsumedWriteCapacityUnits(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the successful request latency for this table.
	//
	// By default, the metric will be calculated as an average over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	MetricSuccessfulRequestLatency(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the system errors this table.
	// Deprecated: use `metricSystemErrorsForOperations`.
	MetricSystemErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the system errors for this table. This will sum errors across all possible operations.
	//
	// By default, each individual metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	MetricSystemErrorsForOperations(props *SystemErrorsForOperationsMetricOptions) awscloudwatch.IMetric
	// How many requests are throttled on this table.
	//
	// By default, each individual metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	// Deprecated: Do not use this function. It returns an invalid metric. Use `metricThrottledRequestsForOperation` instead.
	MetricThrottledRequests(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// How many requests are throttled on this table for the given operation.
	//
	// By default, the metric will be calculated as an average over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	MetricThrottledRequestsForOperation(operation *string, props *OperationsMetricOptions) awscloudwatch.IMetric
	// How many requests are throttled on this table. This will sum errors across all possible operations.
	//
	// By default, each individual metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	MetricThrottledRequestsForOperations(props *OperationsMetricOptions) awscloudwatch.IMetric
	// Metric for the user errors for this table.
	//
	// Note: This metric reports user errors across all the tables in the account and region the table
	// resides in.
	//
	// By default, the metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	MetricUserErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Returns a string representation of this construct.
	ToString() *string
}

Base class for a DynamoDB table.

type TableClass added in v2.11.0

type TableClass string

DynamoDB's table class.

Example:

table := dynamodb.NewTableV2(this, jsii.String("Table"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	ContributorInsights: jsii.Boolean(true),
	TableClass: dynamodb.TableClass_STANDARD_INFREQUENT_ACCESS,
	PointInTimeRecovery: jsii.Boolean(true),
})

See: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.TableClasses.html

const (
	// Default table class for DynamoDB.
	TableClass_STANDARD TableClass = "STANDARD"
	// Table class for DynamoDB that reduces storage costs compared to existing DynamoDB standard tables.
	TableClass_STANDARD_INFREQUENT_ACCESS TableClass = "STANDARD_INFREQUENT_ACCESS"
)

type TableEncryption

type TableEncryption string

What kind of server-side encryption to apply to this table.

const (
	// Server-side KMS encryption with a master key owned by AWS.
	TableEncryption_DEFAULT TableEncryption = "DEFAULT"
	// Server-side KMS encryption with a customer master key managed by customer.
	//
	// If `encryptionKey` is specified, this key will be used, otherwise, one will be defined.
	//
	// > **NOTE**: if `encryptionKey` is not specified and the `Table` construct creates
	// > a KMS key for you, the key will be created with default permissions. If you are using
	// > CDKv2, these permissions will be sufficient to enable the key for use with DynamoDB tables.
	// > If you are using CDKv1, make sure the feature flag `@aws-cdk/aws-kms:defaultKeyPolicies`
	// > is set to `true` in your `cdk.json`.
	TableEncryption_CUSTOMER_MANAGED TableEncryption = "CUSTOMER_MANAGED"
	// Server-side KMS encryption with a master key managed by AWS.
	TableEncryption_AWS_MANAGED TableEncryption = "AWS_MANAGED"
)

type TableEncryptionV2 added in v2.95.0

type TableEncryptionV2 interface {
	ReplicaKeyArns() *map[string]*string
	TableKey() awskms.IKey
	Type() TableEncryption
}

Represents server-side encryption for a DynamoDB table.

Example:

import "github.com/aws/aws-cdk-go/awscdk"
import kms "github.com/aws/aws-cdk-go/awscdk"

app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"), &StackProps{
	Env: &Environment{
		Region: jsii.String("us-west-2"),
	},
})

tableKey := kms.NewKey(stack, jsii.String("Key"))
replicaKeyArns := map[string]*string{
	"us-east-1": jsii.String("arn:aws:kms:us-east-1:123456789012:key/g24efbna-az9b-42ro-m3bp-cq249l94fca6"),
	"us-east-2": jsii.String("arn:aws:kms:us-east-2:123456789012:key/h90bkasj-bs1j-92wp-s2ka-bh857d60bkj8"),
}

globalTable := dynamodb.NewTableV2(stack, jsii.String("GlobalTable"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	Encryption: dynamodb.TableEncryptionV2_CustomerManagedKey(tableKey, replicaKeyArns),
	Replicas: []replicaTableProps{
		&replicaTableProps{
			Region: jsii.String("us-east-1"),
		},
		&replicaTableProps{
			Region: jsii.String("us-east-2"),
		},
	},
})

func TableEncryptionV2_AwsManagedKey added in v2.95.0

func TableEncryptionV2_AwsManagedKey() TableEncryptionV2

Configure server-side encryption using a DynamoDB owned key.

func TableEncryptionV2_CustomerManagedKey added in v2.95.0

func TableEncryptionV2_CustomerManagedKey(tableKey awskms.IKey, replicaKeyArns *map[string]*string) TableEncryptionV2

Configure server-side encryption using customer managed keys.

func TableEncryptionV2_DynamoOwnedKey added in v2.95.0

func TableEncryptionV2_DynamoOwnedKey() TableEncryptionV2

Configure server-side encryption using a DynamoDB owned key.

type TableOptions

type TableOptions struct {
	// Partition key attribute definition.
	PartitionKey *Attribute `field:"required" json:"partitionKey" yaml:"partitionKey"`
	// Sort key attribute definition.
	// Default: no sort key.
	//
	SortKey *Attribute `field:"optional" json:"sortKey" yaml:"sortKey"`
	// Specify how you are charged for read and write throughput and how you manage capacity.
	// Default: PROVISIONED if `replicationRegions` is not specified, PAY_PER_REQUEST otherwise.
	//
	BillingMode BillingMode `field:"optional" json:"billingMode" yaml:"billingMode"`
	// Whether CloudWatch contributor insights is enabled.
	// Default: false.
	//
	ContributorInsightsEnabled *bool `field:"optional" json:"contributorInsightsEnabled" yaml:"contributorInsightsEnabled"`
	// Enables deletion protection for the table.
	// Default: false.
	//
	DeletionProtection *bool `field:"optional" json:"deletionProtection" yaml:"deletionProtection"`
	// Whether server-side encryption with an AWS managed customer master key is enabled.
	//
	// This property cannot be set if `serverSideEncryption` is set.
	//
	// > **NOTE**: if you set this to `CUSTOMER_MANAGED` and `encryptionKey` is not
	// > specified, the key that the Tablet generates for you will be created with
	// > default permissions. If you are using CDKv2, these permissions will be
	// > sufficient to enable the key for use with DynamoDB tables.  If you are
	// > using CDKv1, make sure the feature flag
	// > `@aws-cdk/aws-kms:defaultKeyPolicies` is set to `true` in your `cdk.json`.
	// Default: - The table is encrypted with an encryption key managed by DynamoDB, and you are not charged any fee for using it.
	//
	Encryption TableEncryption `field:"optional" json:"encryption" yaml:"encryption"`
	// External KMS key to use for table encryption.
	//
	// This property can only be set if `encryption` is set to `TableEncryption.CUSTOMER_MANAGED`.
	// Default: - If `encryption` is set to `TableEncryption.CUSTOMER_MANAGED` and this
	// property is undefined, a new KMS key will be created and associated with this table.
	// If `encryption` and this property are both undefined, then the table is encrypted with
	// an encryption key managed by DynamoDB, and you are not charged any fee for using it.
	//
	EncryptionKey awskms.IKey `field:"optional" json:"encryptionKey" yaml:"encryptionKey"`
	// The properties of data being imported from the S3 bucket source to the table.
	// Default: - no data import from the S3 bucket.
	//
	ImportSource *ImportSourceSpecification `field:"optional" json:"importSource" yaml:"importSource"`
	// Whether point-in-time recovery is enabled.
	// Default: - point-in-time recovery is disabled.
	//
	PointInTimeRecovery *bool `field:"optional" json:"pointInTimeRecovery" yaml:"pointInTimeRecovery"`
	// The read capacity for the table.
	//
	// Careful if you add Global Secondary Indexes, as
	// those will share the table's provisioned throughput.
	//
	// Can only be provided if billingMode is Provisioned.
	// Default: 5.
	//
	ReadCapacity *float64 `field:"optional" json:"readCapacity" yaml:"readCapacity"`
	// The removal policy to apply to the DynamoDB Table.
	// Default: RemovalPolicy.RETAIN
	//
	RemovalPolicy awscdk.RemovalPolicy `field:"optional" json:"removalPolicy" yaml:"removalPolicy"`
	// Regions where replica tables will be created.
	// Default: - no replica tables are created.
	//
	ReplicationRegions *[]*string `field:"optional" json:"replicationRegions" yaml:"replicationRegions"`
	// The timeout for a table replication operation in a single region.
	// Default: Duration.minutes(30)
	//
	ReplicationTimeout awscdk.Duration `field:"optional" json:"replicationTimeout" yaml:"replicationTimeout"`
	// When an item in the table is modified, StreamViewType determines what information is written to the stream for this table.
	// Default: - streams are disabled unless `replicationRegions` is specified.
	//
	Stream StreamViewType `field:"optional" json:"stream" yaml:"stream"`
	// Specify the table class.
	// Default: STANDARD.
	//
	TableClass TableClass `field:"optional" json:"tableClass" yaml:"tableClass"`
	// The name of TTL attribute.
	// Default: - TTL is disabled.
	//
	TimeToLiveAttribute *string `field:"optional" json:"timeToLiveAttribute" yaml:"timeToLiveAttribute"`
	// Indicates whether CloudFormation stack waits for replication to finish.
	//
	// If set to false, the CloudFormation resource will mark the resource as
	// created and replication will be completed asynchronously. This property is
	// ignored if replicationRegions property is not set.
	//
	// WARNING:
	// DO NOT UNSET this property if adding/removing multiple replicationRegions
	// in one deployment, as CloudFormation only supports one region replication
	// at a time. CDK overcomes this limitation by waiting for replication to
	// finish before starting new replicationRegion.
	//
	// If the custom resource which handles replication has a physical resource
	// ID with the format `region` instead of `tablename-region` (this would happen
	// if the custom resource hasn't received an event since v1.91.0), DO NOT SET
	// this property to false without making a change to the table name.
	// This will cause the existing replicas to be deleted.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-globaltable.html#cfn-dynamodb-globaltable-replicas
	//
	// Default: true.
	//
	WaitForReplicationToFinish *bool `field:"optional" json:"waitForReplicationToFinish" yaml:"waitForReplicationToFinish"`
	// The write capacity for the table.
	//
	// Careful if you add Global Secondary Indexes, as
	// those will share the table's provisioned throughput.
	//
	// Can only be provided if billingMode is Provisioned.
	// Default: 5.
	//
	WriteCapacity *float64 `field:"optional" json:"writeCapacity" yaml:"writeCapacity"`
}

Properties of a DynamoDB Table.

Use `TableProps` for all table properties.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var bucket bucket
var inputFormat inputFormat
var key key

tableOptions := &TableOptions{
	PartitionKey: &Attribute{
		Name: jsii.String("name"),
		Type: awscdk.Aws_dynamodb.AttributeType_BINARY,
	},

	// the properties below are optional
	BillingMode: awscdk.*Aws_dynamodb.BillingMode_PAY_PER_REQUEST,
	ContributorInsightsEnabled: jsii.Boolean(false),
	DeletionProtection: jsii.Boolean(false),
	Encryption: awscdk.*Aws_dynamodb.TableEncryption_DEFAULT,
	EncryptionKey: key,
	ImportSource: &ImportSourceSpecification{
		Bucket: bucket,
		InputFormat: inputFormat,

		// the properties below are optional
		BucketOwner: jsii.String("bucketOwner"),
		CompressionType: awscdk.*Aws_dynamodb.InputCompressionType_GZIP,
		KeyPrefix: jsii.String("keyPrefix"),
	},
	PointInTimeRecovery: jsii.Boolean(false),
	ReadCapacity: jsii.Number(123),
	RemovalPolicy: cdk.RemovalPolicy_DESTROY,
	ReplicationRegions: []*string{
		jsii.String("replicationRegions"),
	},
	ReplicationTimeout: cdk.Duration_Minutes(jsii.Number(30)),
	SortKey: &Attribute{
		Name: jsii.String("name"),
		Type: awscdk.*Aws_dynamodb.AttributeType_BINARY,
	},
	Stream: awscdk.*Aws_dynamodb.StreamViewType_NEW_IMAGE,
	TableClass: awscdk.*Aws_dynamodb.TableClass_STANDARD,
	TimeToLiveAttribute: jsii.String("timeToLiveAttribute"),
	WaitForReplicationToFinish: jsii.Boolean(false),
	WriteCapacity: jsii.Number(123),
}

type TableOptionsV2 added in v2.95.0

type TableOptionsV2 struct {
	// Whether CloudWatch contributor insights is enabled.
	// Default: false.
	//
	ContributorInsights *bool `field:"optional" json:"contributorInsights" yaml:"contributorInsights"`
	// Whether deletion protection is enabled.
	// Default: false.
	//
	DeletionProtection *bool `field:"optional" json:"deletionProtection" yaml:"deletionProtection"`
	// Kinesis Data Stream to capture item level changes.
	// Default: - no Kinesis Data Stream.
	//
	KinesisStream awskinesis.IStream `field:"optional" json:"kinesisStream" yaml:"kinesisStream"`
	// Whether point-in-time recovery is enabled.
	// Default: false.
	//
	PointInTimeRecovery *bool `field:"optional" json:"pointInTimeRecovery" yaml:"pointInTimeRecovery"`
	// The table class.
	// Default: TableClass.STANDARD
	//
	TableClass TableClass `field:"optional" json:"tableClass" yaml:"tableClass"`
	// Tags to be applied to the table or replica table.
	// Default: - no tags.
	//
	Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"`
}

Options used to configure a DynamoDB table.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var stream stream

tableOptionsV2 := &TableOptionsV2{
	ContributorInsights: jsii.Boolean(false),
	DeletionProtection: jsii.Boolean(false),
	KinesisStream: stream,
	PointInTimeRecovery: jsii.Boolean(false),
	TableClass: awscdk.Aws_dynamodb.TableClass_STANDARD,
	Tags: []cfnTag{
		&cfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}

type TableProps

type TableProps struct {
	// Partition key attribute definition.
	PartitionKey *Attribute `field:"required" json:"partitionKey" yaml:"partitionKey"`
	// Sort key attribute definition.
	// Default: no sort key.
	//
	SortKey *Attribute `field:"optional" json:"sortKey" yaml:"sortKey"`
	// Specify how you are charged for read and write throughput and how you manage capacity.
	// Default: PROVISIONED if `replicationRegions` is not specified, PAY_PER_REQUEST otherwise.
	//
	BillingMode BillingMode `field:"optional" json:"billingMode" yaml:"billingMode"`
	// Whether CloudWatch contributor insights is enabled.
	// Default: false.
	//
	ContributorInsightsEnabled *bool `field:"optional" json:"contributorInsightsEnabled" yaml:"contributorInsightsEnabled"`
	// Enables deletion protection for the table.
	// Default: false.
	//
	DeletionProtection *bool `field:"optional" json:"deletionProtection" yaml:"deletionProtection"`
	// Whether server-side encryption with an AWS managed customer master key is enabled.
	//
	// This property cannot be set if `serverSideEncryption` is set.
	//
	// > **NOTE**: if you set this to `CUSTOMER_MANAGED` and `encryptionKey` is not
	// > specified, the key that the Tablet generates for you will be created with
	// > default permissions. If you are using CDKv2, these permissions will be
	// > sufficient to enable the key for use with DynamoDB tables.  If you are
	// > using CDKv1, make sure the feature flag
	// > `@aws-cdk/aws-kms:defaultKeyPolicies` is set to `true` in your `cdk.json`.
	// Default: - The table is encrypted with an encryption key managed by DynamoDB, and you are not charged any fee for using it.
	//
	Encryption TableEncryption `field:"optional" json:"encryption" yaml:"encryption"`
	// External KMS key to use for table encryption.
	//
	// This property can only be set if `encryption` is set to `TableEncryption.CUSTOMER_MANAGED`.
	// Default: - If `encryption` is set to `TableEncryption.CUSTOMER_MANAGED` and this
	// property is undefined, a new KMS key will be created and associated with this table.
	// If `encryption` and this property are both undefined, then the table is encrypted with
	// an encryption key managed by DynamoDB, and you are not charged any fee for using it.
	//
	EncryptionKey awskms.IKey `field:"optional" json:"encryptionKey" yaml:"encryptionKey"`
	// The properties of data being imported from the S3 bucket source to the table.
	// Default: - no data import from the S3 bucket.
	//
	ImportSource *ImportSourceSpecification `field:"optional" json:"importSource" yaml:"importSource"`
	// Whether point-in-time recovery is enabled.
	// Default: - point-in-time recovery is disabled.
	//
	PointInTimeRecovery *bool `field:"optional" json:"pointInTimeRecovery" yaml:"pointInTimeRecovery"`
	// The read capacity for the table.
	//
	// Careful if you add Global Secondary Indexes, as
	// those will share the table's provisioned throughput.
	//
	// Can only be provided if billingMode is Provisioned.
	// Default: 5.
	//
	ReadCapacity *float64 `field:"optional" json:"readCapacity" yaml:"readCapacity"`
	// The removal policy to apply to the DynamoDB Table.
	// Default: RemovalPolicy.RETAIN
	//
	RemovalPolicy awscdk.RemovalPolicy `field:"optional" json:"removalPolicy" yaml:"removalPolicy"`
	// Regions where replica tables will be created.
	// Default: - no replica tables are created.
	//
	ReplicationRegions *[]*string `field:"optional" json:"replicationRegions" yaml:"replicationRegions"`
	// The timeout for a table replication operation in a single region.
	// Default: Duration.minutes(30)
	//
	ReplicationTimeout awscdk.Duration `field:"optional" json:"replicationTimeout" yaml:"replicationTimeout"`
	// When an item in the table is modified, StreamViewType determines what information is written to the stream for this table.
	// Default: - streams are disabled unless `replicationRegions` is specified.
	//
	Stream StreamViewType `field:"optional" json:"stream" yaml:"stream"`
	// Specify the table class.
	// Default: STANDARD.
	//
	TableClass TableClass `field:"optional" json:"tableClass" yaml:"tableClass"`
	// The name of TTL attribute.
	// Default: - TTL is disabled.
	//
	TimeToLiveAttribute *string `field:"optional" json:"timeToLiveAttribute" yaml:"timeToLiveAttribute"`
	// Indicates whether CloudFormation stack waits for replication to finish.
	//
	// If set to false, the CloudFormation resource will mark the resource as
	// created and replication will be completed asynchronously. This property is
	// ignored if replicationRegions property is not set.
	//
	// WARNING:
	// DO NOT UNSET this property if adding/removing multiple replicationRegions
	// in one deployment, as CloudFormation only supports one region replication
	// at a time. CDK overcomes this limitation by waiting for replication to
	// finish before starting new replicationRegion.
	//
	// If the custom resource which handles replication has a physical resource
	// ID with the format `region` instead of `tablename-region` (this would happen
	// if the custom resource hasn't received an event since v1.91.0), DO NOT SET
	// this property to false without making a change to the table name.
	// This will cause the existing replicas to be deleted.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-globaltable.html#cfn-dynamodb-globaltable-replicas
	//
	// Default: true.
	//
	WaitForReplicationToFinish *bool `field:"optional" json:"waitForReplicationToFinish" yaml:"waitForReplicationToFinish"`
	// The write capacity for the table.
	//
	// Careful if you add Global Secondary Indexes, as
	// those will share the table's provisioned throughput.
	//
	// Can only be provided if billingMode is Provisioned.
	// Default: 5.
	//
	WriteCapacity *float64 `field:"optional" json:"writeCapacity" yaml:"writeCapacity"`
	// Kinesis Data Stream to capture item-level changes for the table.
	// Default: - no Kinesis Data Stream.
	//
	KinesisStream awskinesis.IStream `field:"optional" json:"kinesisStream" yaml:"kinesisStream"`
	// Enforces a particular physical table name.
	// Default: <generated>.
	//
	TableName *string `field:"optional" json:"tableName" yaml:"tableName"`
}

Properties for a DynamoDB Table.

Example:

import "github.com/aws/aws-cdk-go/awscdk"
import s3 "github.com/aws/aws-cdk-go/awscdk"

var bucket iBucket

app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"))

dynamodb.NewTable(stack, jsii.String("Table"), &TableProps{
	PartitionKey: &Attribute{
		Name: jsii.String("id"),
		Type: dynamodb.AttributeType_STRING,
	},
	ImportSource: &ImportSourceSpecification{
		CompressionType: dynamodb.InputCompressionType_GZIP,
		InputFormat: dynamodb.InputFormat_Csv(&CsvOptions{
			Delimiter: jsii.String(","),
			HeaderList: []*string{
				jsii.String("id"),
				jsii.String("name"),
			},
		}),
		Bucket: *Bucket,
		KeyPrefix: jsii.String("prefix"),
	},
})

type TablePropsV2 added in v2.95.0

type TablePropsV2 struct {
	// Whether CloudWatch contributor insights is enabled.
	// Default: false.
	//
	ContributorInsights *bool `field:"optional" json:"contributorInsights" yaml:"contributorInsights"`
	// Whether deletion protection is enabled.
	// Default: false.
	//
	DeletionProtection *bool `field:"optional" json:"deletionProtection" yaml:"deletionProtection"`
	// Kinesis Data Stream to capture item level changes.
	// Default: - no Kinesis Data Stream.
	//
	KinesisStream awskinesis.IStream `field:"optional" json:"kinesisStream" yaml:"kinesisStream"`
	// Whether point-in-time recovery is enabled.
	// Default: false.
	//
	PointInTimeRecovery *bool `field:"optional" json:"pointInTimeRecovery" yaml:"pointInTimeRecovery"`
	// The table class.
	// Default: TableClass.STANDARD
	//
	TableClass TableClass `field:"optional" json:"tableClass" yaml:"tableClass"`
	// Tags to be applied to the table or replica table.
	// Default: - no tags.
	//
	Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"`
	// Partition key attribute definition.
	PartitionKey *Attribute `field:"required" json:"partitionKey" yaml:"partitionKey"`
	// The billing mode and capacity settings to apply to the table.
	// Default: Billing.onDemand()
	//
	Billing Billing `field:"optional" json:"billing" yaml:"billing"`
	// When an item in the table is modified, StreamViewType determines what information is written to the stream.
	// Default: - streams are disabled if replicas are not configured and this property is
	// not specified. If this property is not specified when replicas are configured, then
	// NEW_AND_OLD_IMAGES will be the StreamViewType for all replicas.
	//
	DynamoStream StreamViewType `field:"optional" json:"dynamoStream" yaml:"dynamoStream"`
	// The server-side encryption.
	// Default: TableEncryptionV2.dynamoOwnedKey()
	//
	Encryption TableEncryptionV2 `field:"optional" json:"encryption" yaml:"encryption"`
	// Global secondary indexes.
	//
	// Note: You can provide a maximum of 20 global secondary indexes.
	// Default: - no global secondary indexes.
	//
	GlobalSecondaryIndexes *[]*GlobalSecondaryIndexPropsV2 `field:"optional" json:"globalSecondaryIndexes" yaml:"globalSecondaryIndexes"`
	// Local secondary indexes.
	//
	// Note: You can only provide a maximum of 5 local secondary indexes.
	// Default: - no local secondary indexes.
	//
	LocalSecondaryIndexes *[]*LocalSecondaryIndexProps `field:"optional" json:"localSecondaryIndexes" yaml:"localSecondaryIndexes"`
	// The removal policy applied to the table.
	// Default: RemovalPolicy.RETAIN
	//
	RemovalPolicy awscdk.RemovalPolicy `field:"optional" json:"removalPolicy" yaml:"removalPolicy"`
	// Replica tables to deploy with the primary table.
	//
	// Note: Adding replica tables allows you to use your table as a global table. You
	// cannot specify a replica table in the region that the primary table will be deployed
	// to. Replica tables will only be supported if the stack deployment region is defined.
	// Default: - no replica tables.
	//
	Replicas *[]*ReplicaTableProps `field:"optional" json:"replicas" yaml:"replicas"`
	// Sort key attribute definition.
	// Default: - no sort key.
	//
	SortKey *Attribute `field:"optional" json:"sortKey" yaml:"sortKey"`
	// The name of the table.
	// Default: - generated by CloudFormation.
	//
	TableName *string `field:"optional" json:"tableName" yaml:"tableName"`
	// The name of the TTL attribute.
	// Default: - TTL is disabled.
	//
	TimeToLiveAttribute *string `field:"optional" json:"timeToLiveAttribute" yaml:"timeToLiveAttribute"`
}

Properties used to configure a DynamoDB table.

Example:

import "github.com/aws/aws-cdk-go/awscdk"

app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"), &StackProps{
	Env: &Environment{
		Region: jsii.String("us-west-2"),
	},
})

globalTable := dynamodb.NewTableV2(stack, jsii.String("GlobalTable"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	// applys to all replicas, i.e., us-west-2, us-east-1, us-east-2
	RemovalPolicy: cdk.RemovalPolicy_DESTROY,
	Replicas: []replicaTableProps{
		&replicaTableProps{
			Region: jsii.String("us-east-1"),
		},
		&replicaTableProps{
			Region: jsii.String("us-east-2"),
		},
	},
})

type TableV2 added in v2.95.0

type TableV2 interface {
	TableBaseV2
	// The KMS encryption key for the table.
	EncryptionKey() awskms.IKey
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	Env() *awscdk.ResourceEnvironment
	HasIndex() *bool
	// The tree node.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	PhysicalName() *string
	Region() *string
	// The stack in which this resource is defined.
	Stack() awscdk.Stack
	// The ARN of the table.
	TableArn() *string
	// The ID of the table.
	TableId() *string
	// The name of the table.
	TableName() *string
	// The stream ARN of the table.
	TableStreamArn() *string
	// Add a global secondary index to the table.
	//
	// Note: Global secondary indexes will be inherited by all replica tables.
	AddGlobalSecondaryIndex(props *GlobalSecondaryIndexPropsV2)
	// Add a local secondary index to the table.
	//
	// Note: Local secondary indexes will be inherited by all replica tables.
	AddLocalSecondaryIndex(props *LocalSecondaryIndexProps)
	// Add a replica table.
	//
	// Note: Adding a replica table will allow you to use your table as a global table.
	AddReplica(props *ReplicaTableProps)
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	GetResourceNameAttribute(nameAttr *string) *string
	// Adds an IAM policy statement associated with this table to an IAM principal's policy.
	//
	// Note: If `encryptionKey` is present, appropriate grants to the key needs to be added
	// separately using the `table.encryptionKey.grant*` methods.
	Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant
	// Permits an IAM principal to all DynamoDB operations ('dynamodb:*') on this table.
	//
	// Note: Appropriate grants will also be added to the customer-managed KMS keys associated with this
	// table if one was configured.
	GrantFullAccess(grantee awsiam.IGrantable) awsiam.Grant
	// Permits an IAM principal all data read operations on this table.
	//
	// Actions: BatchGetItem, GetRecords, GetShardIterator, Query, GetItem, Scan, DescribeTable.
	//
	// Note: Appropriate grants will also be added to the customer-managed KMS keys associated with this
	// table if one was configured.
	GrantReadData(grantee awsiam.IGrantable) awsiam.Grant
	// Permits an IAM principal to all data read/write operations on this table.
	//
	// Actions: BatchGetItem, GetRecords, GetShardIterator, Query, GetItem, Scan, BatchWriteItem, PutItem, UpdateItem,
	// DeleteItem, DescribeTable.
	//
	// Note: Appropriate grants will also be added to the customer-managed KMS keys associated with this
	// table if one was configured.
	GrantReadWriteData(grantee awsiam.IGrantable) awsiam.Grant
	// Adds an IAM policy statement associated with this table to an IAM principal's policy.
	//
	// Note: If `encryptionKey` is present, appropriate grants to the key needs to be added
	// separately using the `table.encryptionKey.grant*` methods.
	GrantStream(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant
	// Adds an IAM policy statement associated with this table to an IAM principal's policy.
	//
	// Actions: DescribeStream, GetRecords, GetShardIterator, ListStreams.
	//
	// Note: Appropriate grants will also be added to the customer-managed KMS keys associated with this
	// table if one was configured.
	GrantStreamRead(grantee awsiam.IGrantable) awsiam.Grant
	// Permits an IAM principal to list streams attached to this table.
	GrantTableListStreams(grantee awsiam.IGrantable) awsiam.Grant
	// Permits an IAM principal all data write operations on this table.
	//
	// Actions: BatchWriteItem, PutItem, UpdateItem, DeleteItem, DescribeTable.
	//
	// Note: Appropriate grants will also be added to the customer-managed KMS keys associated with this
	// table if one was configured.
	GrantWriteData(grantee awsiam.IGrantable) awsiam.Grant
	// Return the given named metric for this table.
	//
	// By default, the metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the conditional check failed requests for this table.
	//
	// By default, the metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	MetricConditionalCheckFailedRequests(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the consumed read capacity units for this table.
	//
	// By default, the metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	MetricConsumedReadCapacityUnits(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the consumed write capacity units for this table.
	//
	// By default, the metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	MetricConsumedWriteCapacityUnits(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the successful request latency for this table.
	//
	// By default, the metric will be calculated as an average over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	MetricSuccessfulRequestLatency(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the system errors this table.
	// Deprecated: use `metricSystemErrorsForOperations`.
	MetricSystemErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the system errors for this table. This will sum errors across all possible operations.
	//
	// By default, each individual metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	MetricSystemErrorsForOperations(props *SystemErrorsForOperationsMetricOptions) awscloudwatch.IMetric
	// How many requests are throttled on this table.
	//
	// By default, each individual metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	// Deprecated: Do not use this function. It returns an invalid metric. Use `metricThrottledRequestsForOperation` instead.
	MetricThrottledRequests(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// How many requests are throttled on this table for the given operation.
	//
	// By default, the metric will be calculated as an average over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	MetricThrottledRequestsForOperation(operation *string, props *OperationsMetricOptions) awscloudwatch.IMetric
	// How many requests are throttled on this table. This will sum errors across all possible operations.
	//
	// By default, each individual metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	MetricThrottledRequestsForOperations(props *OperationsMetricOptions) awscloudwatch.IMetric
	// Metric for the user errors for this table.
	//
	// Note: This metric reports user errors across all the tables in the account and region the table
	// resides in.
	//
	// By default, the metric will be calculated as a sum over a period of 5 minutes.
	// You can customize this by using the `statistic` and `period` properties.
	MetricUserErrors(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Retrieve a replica table.
	//
	// Note: Replica tables are not supported in a region agnostic stack.
	Replica(region *string) ITableV2
	// Returns a string representation of this construct.
	ToString() *string
}

A DynamoDB Table.

Example:

import "github.com/aws/aws-cdk-go/awscdk"

app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"), &StackProps{
	Env: &Environment{
		Region: jsii.String("us-west-2"),
	},
})

globalTable := dynamodb.NewTableV2(stack, jsii.String("GlobalTable"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	// applys to all replicas, i.e., us-west-2, us-east-1, us-east-2
	RemovalPolicy: cdk.RemovalPolicy_DESTROY,
	Replicas: []replicaTableProps{
		&replicaTableProps{
			Region: jsii.String("us-east-1"),
		},
		&replicaTableProps{
			Region: jsii.String("us-east-2"),
		},
	},
})

func NewTableV2 added in v2.95.0

func NewTableV2(scope constructs.Construct, id *string, props *TablePropsV2) TableV2

type ThroughputProps added in v2.95.0

type ThroughputProps struct {
	// The read capacity.
	ReadCapacity Capacity `field:"required" json:"readCapacity" yaml:"readCapacity"`
	// The write capacity.
	WriteCapacity Capacity `field:"required" json:"writeCapacity" yaml:"writeCapacity"`
}

Properties used to configure provisioned throughput for a DynamoDB table.

Example:

import "github.com/aws/aws-cdk-go/awscdk"

app := cdk.NewApp()
stack := cdk.NewStack(app, jsii.String("Stack"), &StackProps{
	Env: &Environment{
		Region: jsii.String("us-west-2"),
	},
})

globalTable := dynamodb.NewTableV2(stack, jsii.String("GlobalTable"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	Billing: dynamodb.Billing_Provisioned(&ThroughputProps{
		ReadCapacity: dynamodb.Capacity_Fixed(jsii.Number(10)),
		WriteCapacity: dynamodb.Capacity_Autoscaled(&AutoscaledCapacityOptions{
			MaxCapacity: jsii.Number(15),
		}),
	}),
	Replicas: []replicaTableProps{
		&replicaTableProps{
			Region: jsii.String("us-east-1"),
		},
		&replicaTableProps{
			Region: jsii.String("us-east-2"),
			ReadCapacity: dynamodb.Capacity_*Autoscaled(&AutoscaledCapacityOptions{
				MaxCapacity: jsii.Number(20),
				TargetUtilizationPercent: jsii.Number(50),
			}),
		},
	},
})

type UtilizationScalingProps

type UtilizationScalingProps struct {
	// Indicates whether scale in by the target tracking policy is disabled.
	//
	// If the value is true, scale in is disabled and the target tracking policy
	// won't remove capacity from the scalable resource. Otherwise, scale in is
	// enabled and the target tracking policy can remove capacity from the
	// scalable resource.
	// Default: false.
	//
	DisableScaleIn *bool `field:"optional" json:"disableScaleIn" yaml:"disableScaleIn"`
	// A name for the scaling policy.
	// Default: - Automatically generated name.
	//
	PolicyName *string `field:"optional" json:"policyName" yaml:"policyName"`
	// Period after a scale in activity completes before another scale in activity can start.
	// Default: Duration.seconds(300) for the following scalable targets: ECS services,
	// Spot Fleet requests, EMR clusters, AppStream 2.0 fleets, Aurora DB clusters,
	// Amazon SageMaker endpoint variants, Custom resources. For all other scalable
	// targets, the default value is Duration.seconds(0): DynamoDB tables, DynamoDB
	// global secondary indexes, Amazon Comprehend document classification endpoints,
	// Lambda provisioned concurrency.
	//
	ScaleInCooldown awscdk.Duration `field:"optional" json:"scaleInCooldown" yaml:"scaleInCooldown"`
	// Period after a scale out activity completes before another scale out activity can start.
	// Default: Duration.seconds(300) for the following scalable targets: ECS services,
	// Spot Fleet requests, EMR clusters, AppStream 2.0 fleets, Aurora DB clusters,
	// Amazon SageMaker endpoint variants, Custom resources. For all other scalable
	// targets, the default value is Duration.seconds(0): DynamoDB tables, DynamoDB
	// global secondary indexes, Amazon Comprehend document classification endpoints,
	// Lambda provisioned concurrency.
	//
	ScaleOutCooldown awscdk.Duration `field:"optional" json:"scaleOutCooldown" yaml:"scaleOutCooldown"`
	// Target utilization percentage for the attribute.
	TargetUtilizationPercent *float64 `field:"required" json:"targetUtilizationPercent" yaml:"targetUtilizationPercent"`
}

Properties for enabling DynamoDB utilization tracking.

Example:

import dynamodb "github.com/aws/aws-cdk-go/awscdk"

var table table

readCapacity := table.AutoScaleReadCapacity(&EnableScalingProps{
	MinCapacity: jsii.Number(10),
	MaxCapacity: jsii.Number(1000),
})
readCapacity.ScaleOnUtilization(&UtilizationScalingProps{
	TargetUtilizationPercent: jsii.Number(60),
})

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL