Class TablePropsV2
Properties used to configure a DynamoDB table.
Inheritance
Namespace: Amazon.CDK.AWS.DynamoDB
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class TablePropsV2 : Object, ITablePropsV2, ITableOptionsV2
Syntax (vb)
Public Class TablePropsV2
Inherits Object
Implements ITablePropsV2, ITableOptionsV2
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK;
var app = new App();
var stack = new Stack(app, "Stack", new StackProps { Env = new Environment { Region = "us-west-2" } });
var globalTable = new TableV2(stack, "GlobalTable", new TablePropsV2 {
PartitionKey = new Attribute { Name = "pk", Type = AttributeType.STRING },
// applys to all replicas, i.e., us-west-2, us-east-1, us-east-2
RemovalPolicy = RemovalPolicy.DESTROY,
Replicas = new [] { new ReplicaTableProps { Region = "us-east-1" }, new ReplicaTableProps { Region = "us-east-2" } }
});
Synopsis
Constructors
TablePropsV2() |
Properties
Billing | The billing mode and capacity settings to apply to the table. |
ContributorInsights | Whether CloudWatch contributor insights is enabled. |
DeletionProtection | Whether deletion protection is enabled. |
DynamoStream | When an item in the table is modified, StreamViewType determines what information is written to the stream. |
Encryption | The server-side encryption. |
GlobalSecondaryIndexes | Global secondary indexes. |
KinesisStream | Kinesis Data Stream to capture item level changes. |
LocalSecondaryIndexes | Local secondary indexes. |
PartitionKey | Partition key attribute definition. |
PointInTimeRecovery | Whether point-in-time recovery is enabled. |
RemovalPolicy | The removal policy applied to the table. |
Replicas | Replica tables to deploy with the primary table. |
SortKey | Sort key attribute definition. |
TableClass | The table class. |
TableName | The name of the table. |
Tags | Tags to be applied to the table or replica table. |
TimeToLiveAttribute | The name of the TTL attribute. |
Constructors
TablePropsV2()
public TablePropsV2()
Properties
Billing
The billing mode and capacity settings to apply to the table.
public Billing Billing { get; set; }
Property Value
Remarks
Default: Billing.onDemand()
ContributorInsights
Whether CloudWatch contributor insights is enabled.
public Nullable<bool> ContributorInsights { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false
DeletionProtection
Whether deletion protection is enabled.
public Nullable<bool> DeletionProtection { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false
DynamoStream
When an item in the table is modified, StreamViewType determines what information is written to the stream.
public Nullable<StreamViewType> DynamoStream { get; set; }
Property Value
System.Nullable<StreamViewType>
Remarks
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
Encryption
The server-side encryption.
public TableEncryptionV2 Encryption { get; set; }
Property Value
Remarks
Default: TableEncryptionV2.dynamoOwnedKey()
GlobalSecondaryIndexes
Global secondary indexes.
public IGlobalSecondaryIndexPropsV2[] GlobalSecondaryIndexes { get; set; }
Property Value
IGlobalSecondaryIndexPropsV2[]
Remarks
Note: You can provide a maximum of 20 global secondary indexes.
Default: - no global secondary indexes
KinesisStream
Kinesis Data Stream to capture item level changes.
public IStream KinesisStream { get; set; }
Property Value
Remarks
Default: - no Kinesis Data Stream
LocalSecondaryIndexes
Local secondary indexes.
public ILocalSecondaryIndexProps[] LocalSecondaryIndexes { get; set; }
Property Value
Remarks
Note: You can only provide a maximum of 5 local secondary indexes.
Default: - no local secondary indexes
PartitionKey
Partition key attribute definition.
public IAttribute PartitionKey { get; set; }
Property Value
PointInTimeRecovery
Whether point-in-time recovery is enabled.
public Nullable<bool> PointInTimeRecovery { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false
RemovalPolicy
The removal policy applied to the table.
public Nullable<RemovalPolicy> RemovalPolicy { get; set; }
Property Value
System.Nullable<RemovalPolicy>
Remarks
Default: RemovalPolicy.RETAIN
Replicas
Replica tables to deploy with the primary table.
public IReplicaTableProps[] Replicas { get; set; }
Property Value
Remarks
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
SortKey
Sort key attribute definition.
public IAttribute SortKey { get; set; }
Property Value
Remarks
Default: - no sort key
TableClass
The table class.
public Nullable<TableClass> TableClass { get; set; }
Property Value
System.Nullable<TableClass>
Remarks
Default: TableClass.STANDARD
TableName
The name of the table.
public string TableName { get; set; }
Property Value
System.String
Remarks
Default: - generated by CloudFormation
Tags
Tags to be applied to the table or replica table.
public ICfnTag[] Tags { get; set; }
Property Value
ICfnTag[]
Remarks
Default: - no tags
TimeToLiveAttribute
The name of the TTL attribute.
public string TimeToLiveAttribute { get; set; }
Property Value
System.String
Remarks
Default: - TTL is disabled