Show / Hide Table of Contents

Class Table

Provides a DynamoDB table.

Inheritance
System.Object
Construct
Resource
Table
Implements
ITable
IResource
IConstruct
Constructs.IConstruct
IDependable
Inherited Members
Resource.IsResource(IConstruct)
Resource.ApplyRemovalPolicy(RemovalPolicy)
Resource.GeneratePhysicalName()
Resource.GetResourceArnAttribute(String, IArnComponents)
Resource.GetResourceNameAttribute(String)
Resource.Env
Resource.PhysicalName
Resource.Stack
Construct.IsConstruct(Object)
Construct.OnPrepare()
Construct.OnSynthesize(ISynthesisSession)
Construct.OnValidate()
Construct.Prepare()
Construct.Synthesize(ISynthesisSession)
Construct.Node
Namespace: Amazon.CDK.AWS.DynamoDB
Assembly: Amazon.CDK.AWS.DynamoDB.dll
Syntax (csharp)
public class Table : Resource, ITable, IResource, IConstruct, IConstruct, IDependable
Syntax (vb)
Public Class Table
    Inherits Resource
    Implements ITable, IResource, IConstruct, IConstruct, IDependable

Synopsis

Constructors

Table(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

Table(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

Table(Construct, String, ITableProps)

Properties

EncryptionKey

KMS encryption key, if this table uses a customer-managed encryption key.

HasIndex

Whether this table has indexes.

RegionalArns
TableArn

Arn of the dynamodb table.

TableName

Table name of the dynamodb table.

TableStreamArn

ARN of the table's stream, if there is one.

Methods

AddGlobalSecondaryIndex(IGlobalSecondaryIndexProps)

Add a global secondary index of table.

AddLocalSecondaryIndex(ILocalSecondaryIndexProps)

Add a local secondary index of table.

AutoScaleGlobalSecondaryIndexReadCapacity(String, IEnableScalingProps)

Enable read capacity scaling for the given GSI.

AutoScaleGlobalSecondaryIndexWriteCapacity(String, IEnableScalingProps)

Enable write capacity scaling for the given GSI.

AutoScaleReadCapacity(IEnableScalingProps)

Enable read capacity scaling for this table.

AutoScaleWriteCapacity(IEnableScalingProps)

Enable write capacity scaling for this table.

FromTableArn(Construct, String, String)

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

FromTableAttributes(Construct, String, ITableAttributes)

Creates a Table construct that represents an external table.

FromTableName(Construct, String, String)

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

Grant(IGrantable, String[])

Adds an IAM policy statement associated with this table to an IAM principal's policy.

GrantFullAccess(IGrantable)

Permits all DynamoDB operations ("dynamodb:*") to an IAM principal.

GrantListStreams(IGrantable)

(deprecated) Permits an IAM Principal to list all DynamoDB Streams.

GrantReadData(IGrantable)

Permits an IAM principal all data read operations from this table: BatchGetItem, GetRecords, GetShardIterator, Query, GetItem, Scan.

GrantReadWriteData(IGrantable)

Permits an IAM principal to all data read/write operations to this table.

GrantStream(IGrantable, String[])

Adds an IAM policy statement associated with this table's stream to an IAM principal's policy.

GrantStreamRead(IGrantable)

Permits an IAM principal all stream data read operations for this table's stream: DescribeStream, GetRecords, GetShardIterator, ListStreams.

GrantTableListStreams(IGrantable)

Permits an IAM Principal to list streams attached to current dynamodb table.

GrantWriteData(IGrantable)

Permits an IAM principal all data write operations to this table: BatchWriteItem, PutItem, UpdateItem, DeleteItem.

Metric(String, IMetricOptions)

Return the given named metric for this Table.

MetricConditionalCheckFailedRequests(IMetricOptions)

Metric for the conditional check failed requests this table.

MetricConsumedReadCapacityUnits(IMetricOptions)

Metric for the consumed read capacity units this table.

MetricConsumedWriteCapacityUnits(IMetricOptions)

Metric for the consumed write capacity units this table.

MetricSuccessfulRequestLatency(IMetricOptions)

Metric for the successful request latency this table.

MetricSystemErrors(IMetricOptions)

(deprecated) Metric for the system errors this table.

MetricSystemErrorsForOperations(ISystemErrorsForOperationsMetricOptions)

Metric for the system errors this table.

MetricThrottledRequests(IMetricOptions)

How many requests are throttled on this table.

MetricUserErrors(IMetricOptions)

Metric for the user errors.

Validate()

Validate the table construct.

Constructors

Table(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

protected Table(ByRefValue reference)
Parameters
reference Amazon.JSII.Runtime.Deputy.ByRefValue

The Javascript-owned object reference

Table(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

protected Table(DeputyBase.DeputyProps props)
Parameters
props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps

The deputy props

Table(Construct, String, ITableProps)

public Table(Construct scope, string id, ITableProps props)
Parameters
scope Constructs.Construct
id System.String
props ITableProps

Properties

EncryptionKey

KMS encryption key, if this table uses a customer-managed encryption key.

public virtual IKey EncryptionKey { get; }
Property Value

IKey

HasIndex

Whether this table has indexes.

protected virtual bool HasIndex { get; }
Property Value

System.Boolean

RegionalArns

protected virtual string[] RegionalArns { get; }
Property Value

System.String[]

TableArn

Arn of the dynamodb table.

public virtual string TableArn { get; }
Property Value

System.String

Remarks

Attribute: true

TableName

Table name of the dynamodb table.

public virtual string TableName { get; }
Property Value

System.String

Remarks

Attribute: true

TableStreamArn

ARN of the table's stream, if there is one.

public virtual string TableStreamArn { get; }
Property Value

System.String

Remarks

Attribute: true

Methods

AddGlobalSecondaryIndex(IGlobalSecondaryIndexProps)

Add a global secondary index of table.

public virtual void AddGlobalSecondaryIndex(IGlobalSecondaryIndexProps props)
Parameters
props IGlobalSecondaryIndexProps

the property of global secondary index.

AddLocalSecondaryIndex(ILocalSecondaryIndexProps)

Add a local secondary index of table.

public virtual void AddLocalSecondaryIndex(ILocalSecondaryIndexProps props)
Parameters
props ILocalSecondaryIndexProps

the property of local secondary index.

AutoScaleGlobalSecondaryIndexReadCapacity(String, IEnableScalingProps)

Enable read capacity scaling for the given GSI.

public virtual IScalableTableAttribute AutoScaleGlobalSecondaryIndexReadCapacity(string indexName, IEnableScalingProps props)
Parameters
indexName System.String
props IEnableScalingProps
Returns

IScalableTableAttribute

An object to configure additional AutoScaling settings for this attribute

AutoScaleGlobalSecondaryIndexWriteCapacity(String, IEnableScalingProps)

Enable write capacity scaling for the given GSI.

public virtual IScalableTableAttribute AutoScaleGlobalSecondaryIndexWriteCapacity(string indexName, IEnableScalingProps props)
Parameters
indexName System.String
props IEnableScalingProps
Returns

IScalableTableAttribute

An object to configure additional AutoScaling settings for this attribute

AutoScaleReadCapacity(IEnableScalingProps)

Enable read capacity scaling for this table.

public virtual IScalableTableAttribute AutoScaleReadCapacity(IEnableScalingProps props)
Parameters
props IEnableScalingProps
Returns

IScalableTableAttribute

An object to configure additional AutoScaling settings

AutoScaleWriteCapacity(IEnableScalingProps)

Enable write capacity scaling for this table.

public virtual IScalableTableAttribute AutoScaleWriteCapacity(IEnableScalingProps props)
Parameters
props IEnableScalingProps
Returns

IScalableTableAttribute

An object to configure additional AutoScaling settings for this attribute

FromTableArn(Construct, String, String)

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

public static ITable FromTableArn(Construct scope, string id, string tableArn)
Parameters
scope Constructs.Construct

The parent creating construct (usually this).

id System.String

The construct's name.

tableArn System.String

The table's ARN.

Returns

ITable

FromTableAttributes(Construct, String, ITableAttributes)

Creates a Table construct that represents an external table.

public static ITable FromTableAttributes(Construct scope, string id, ITableAttributes attrs)
Parameters
scope Constructs.Construct

The parent creating construct (usually this).

id System.String

The construct's name.

attrs ITableAttributes

A TableAttributes object.

Returns

ITable

FromTableName(Construct, String, String)

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

public static ITable FromTableName(Construct scope, string id, string tableName)
Parameters
scope Constructs.Construct

The parent creating construct (usually this).

id System.String

The construct's name.

tableName System.String

The table's name.

Returns

ITable

Grant(IGrantable, String[])

Adds an IAM policy statement associated with this table to an IAM principal's policy.

public virtual Grant Grant(IGrantable grantee, params string[] actions)
Parameters
grantee IGrantable

The principal (no-op if undefined).

actions System.String[]

The set of actions to allow (i.e. "dynamodb:PutItem", "dynamodb:GetItem", ...).

Returns

Grant

Remarks

If encryptionKey is present, appropriate grants to the key needs to be added separately using the table.encryptionKey.grant* methods.

GrantFullAccess(IGrantable)

Permits all DynamoDB operations ("dynamodb:*") to an IAM principal.

public virtual Grant GrantFullAccess(IGrantable grantee)
Parameters
grantee IGrantable

The principal to grant access to.

Returns

Grant

Remarks

Appropriate grants will also be added to the customer-managed KMS key if one was configured.

GrantListStreams(IGrantable)

(deprecated) Permits an IAM Principal to list all DynamoDB Streams.

public static Grant GrantListStreams(IGrantable grantee)
Parameters
grantee IGrantable

The principal (no-op if undefined).

Returns

Grant

Remarks

Stability: Deprecated

GrantReadData(IGrantable)

Permits an IAM principal all data read operations from this table: BatchGetItem, GetRecords, GetShardIterator, Query, GetItem, Scan.

public virtual Grant GrantReadData(IGrantable grantee)
Parameters
grantee IGrantable

The principal to grant access to.

Returns

Grant

Remarks

Appropriate grants will also be added to the customer-managed KMS key if one was configured.

GrantReadWriteData(IGrantable)

Permits an IAM principal to all data read/write operations to this table.

public virtual Grant GrantReadWriteData(IGrantable grantee)
Parameters
grantee IGrantable

The principal to grant access to.

Returns

Grant

Remarks

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.

GrantStream(IGrantable, String[])

Adds an IAM policy statement associated with this table's stream to an IAM principal's policy.

public virtual Grant GrantStream(IGrantable grantee, params string[] actions)
Parameters
grantee IGrantable

The principal (no-op if undefined).

actions System.String[]

The set of actions to allow (i.e. "dynamodb:DescribeStream", "dynamodb:GetRecords", ...).

Returns

Grant

Remarks

If encryptionKey is present, appropriate grants to the key needs to be added separately using the table.encryptionKey.grant* methods.

GrantStreamRead(IGrantable)

Permits an IAM principal all stream data read operations for this table's stream: DescribeStream, GetRecords, GetShardIterator, ListStreams.

public virtual Grant GrantStreamRead(IGrantable grantee)
Parameters
grantee IGrantable

The principal to grant access to.

Returns

Grant

Remarks

Appropriate grants will also be added to the customer-managed KMS key if one was configured.

GrantTableListStreams(IGrantable)

Permits an IAM Principal to list streams attached to current dynamodb table.

public virtual Grant GrantTableListStreams(IGrantable grantee)
Parameters
grantee IGrantable

The principal (no-op if undefined).

Returns

Grant

GrantWriteData(IGrantable)

Permits an IAM principal all data write operations to this table: BatchWriteItem, PutItem, UpdateItem, DeleteItem.

public virtual Grant GrantWriteData(IGrantable grantee)
Parameters
grantee IGrantable

The principal to grant access to.

Returns

Grant

Remarks

Appropriate grants will also be added to the customer-managed KMS key if one was configured.

Metric(String, IMetricOptions)

Return the given named metric for this Table.

public virtual Metric Metric(string metricName, IMetricOptions props = null)
Parameters
metricName System.String
props IMetricOptions
Returns

Metric

Remarks

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(IMetricOptions)

Metric for the conditional check failed requests this table.

public virtual Metric MetricConditionalCheckFailedRequests(IMetricOptions props = null)
Parameters
props IMetricOptions
Returns

Metric

Remarks

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(IMetricOptions)

Metric for the consumed read capacity units this table.

public virtual Metric MetricConsumedReadCapacityUnits(IMetricOptions props = null)
Parameters
props IMetricOptions
Returns

Metric

Remarks

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(IMetricOptions)

Metric for the consumed write capacity units this table.

public virtual Metric MetricConsumedWriteCapacityUnits(IMetricOptions props = null)
Parameters
props IMetricOptions
Returns

Metric

Remarks

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.

MetricSuccessfulRequestLatency(IMetricOptions)

Metric for the successful request latency this table.

public virtual Metric MetricSuccessfulRequestLatency(IMetricOptions props = null)
Parameters
props IMetricOptions
Returns

Metric

Remarks

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.

MetricSystemErrors(IMetricOptions)

(deprecated) Metric for the system errors this table.

public virtual Metric MetricSystemErrors(IMetricOptions props = null)
Parameters
props IMetricOptions
Returns

Metric

Remarks

Stability: Deprecated

MetricSystemErrorsForOperations(ISystemErrorsForOperationsMetricOptions)

Metric for the system errors this table.

public virtual IMetric MetricSystemErrorsForOperations(ISystemErrorsForOperationsMetricOptions props = null)
Parameters
props ISystemErrorsForOperationsMetricOptions
Returns

IMetric

Remarks

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.

MetricThrottledRequests(IMetricOptions)

How many requests are throttled on this table.

public virtual Metric MetricThrottledRequests(IMetricOptions props = null)
Parameters
props IMetricOptions
Returns

Metric

Remarks

Default: sum over 5 minutes

MetricUserErrors(IMetricOptions)

Metric for the user errors.

public virtual Metric MetricUserErrors(IMetricOptions props = null)
Parameters
props IMetricOptions
Returns

Metric

Remarks

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.

Validate()

Validate the table construct.

protected override string[] Validate()
Returns

System.String[]

an array of validation error message

Overrides
Construct.Validate()

Implements

ITable
IResource
IConstruct
Constructs.IConstruct
IDependable
Back to top Generated by DocFX