Skip to content
v2.273.0

TableV2 L2 construct ​

A DynamoDB Table.

Example ​

ts
import * as cdk from 'aws-cdk-lib';

const app = new cdk.App();
const stack = new cdk.Stack(app, 'Stack', { env: { region: 'us-west-2' } });

const mrscTable = new dynamodb.TableV2(stack, 'MRSCTable', {
  partitionKey: { name: 'pk', type: dynamodb.AttributeType.STRING },
  multiRegionConsistency: dynamodb.MultiRegionConsistency.STRONG,
  replicas: [
    { region: 'us-east-1' },
  ],
  witnessRegion: 'us-east-2',
});
python
import aws_cdk as cdk


app = cdk.App()
stack = cdk.Stack(app, "Stack", env=cdk.Environment(region="us-west-2"))

mrsc_table = dynamodb.TableV2(stack, "MRSCTable",
    partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING),
    multi_region_consistency=dynamodb.MultiRegionConsistency.STRONG,
    replicas=[dynamodb.ReplicaTableProps(region="us-east-1")
    ],
    witness_region="us-east-2"
)
java
import software.amazon.awscdk.*;


App app = new App();
Stack stack = Stack.Builder.create(app, "Stack").env(Environment.builder().region("us-west-2").build()).build();

TableV2 mrscTable = TableV2.Builder.create(stack, "MRSCTable")
        .partitionKey(Attribute.builder().name("pk").type(AttributeType.STRING).build())
        .multiRegionConsistency(MultiRegionConsistency.STRONG)
        .replicas(List.of(ReplicaTableProps.builder().region("us-east-1").build()))
        .witnessRegion("us-east-2")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
using Amazon.CDK;


var app = new App();
var stack = new Stack(app, "Stack", new StackProps { Env = new Environment { Region = "us-west-2" } });

var mrscTable = new TableV2(stack, "MRSCTable", new TablePropsV2 {
    PartitionKey = new Attribute { Name = "pk", Type = AttributeType.STRING },
    MultiRegionConsistency = MultiRegionConsistency.STRONG,
    Replicas = new [] { new ReplicaTableProps { Region = "us-east-1" } },
    WitnessRegion = "us-east-2"
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
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"),
	},
})

mrscTable := dynamodb.NewTableV2(stack, jsii.String("MRSCTable"), &TablePropsV2{
	PartitionKey: &Attribute{
		Name: jsii.String("pk"),
		Type: dynamodb.AttributeType_STRING,
	},
	MultiRegionConsistency: dynamodb.MultiRegionConsistency_STRONG,
	Replicas: []ReplicaTableProps{
		&ReplicaTableProps{
			Region: jsii.String("us-east-1"),
		},
	},
	WitnessRegion: jsii.String("us-east-2"),
})

Initializer ​

ts
new TableV2(scope: Construct, id: string, props: TablePropsV2)
python
TableV2(scope: Construct, id: str, props: TablePropsV2)
java
new TableV2(Construct scope, String id, TablePropsV2 props)
csharp
new TableV2(Construct scope, string id, TablePropsV2 props)
go
NewTableV2(Scope Construct, Id *string, Props TablePropsV2)

Construct Props ​

billingBillingbillingBillingbillingBillingBillingBillingBillingBilling= Billing.onDemand()#
The billing mode and capacity settings to apply to the table.
contributorInsightsbooleancontributor_insightsboolcontributorInsightsBooleanContributorInsightsboolContributorInsights*bool= falsedeprecated#
use `contributorInsightsSpecification` instead
contributorInsightsSpecificationContributorInsightsSpecificationcontributor_insights_specificationContributorInsightsSpecificationcontributorInsightsSpecificationContributorInsightsSpecificationContributorInsightsSpecificationContributorInsightsSpecificationContributorInsightsSpecificationContributorInsightsSpecification= contributor insights is not enab…#
Whether CloudWatch contributor insights is enabled and what mode is selected.
default

Default: contributor insights is not enabled

deletionProtectionbooleandeletion_protectionbooldeletionProtectionBooleanDeletionProtectionboolDeletionProtection*bool= false#
Whether deletion protection is enabled.
dynamoStreamStreamViewTypedynamo_streamStreamViewTypedynamoStreamStreamViewTypeDynamoStreamStreamViewTypeDynamoStreamStreamViewType= streams are disabled if replicas…#
When an item in the table is modified, StreamViewType determines what information is written to the stream.
default

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

encryptionTableEncryptionV2encryptionTableEncryptionV2encryptionTableEncryptionV2EncryptionTableEncryptionV2EncryptionTableEncryptionV2= TableEncryptionV2.dynamoOwnedKey…#
The server-side encryption.
default

Default: TableEncryptionV2.dynamoOwnedKey()

globalSecondaryIndexesGlobalSecondaryIndexPropsV2[]global_secondary_indexestyping.List[GlobalSecondaryIndexPropsV2]globalSecondaryIndexesList<GlobalSecondaryIndexPropsV2>GlobalSecondaryIndexesGlobalSecondaryIndexPropsV2[]GlobalSecondaryIndexes*[]GlobalSecondaryIndexPropsV2= no global secondary indexes#
Global secondary indexes.

Note: You can provide a maximum of 20 global secondary indexes.

globalTableSettingsReplicationModeGlobalTableSettingsReplicationModeglobal_table_settings_replication_modeGlobalTableSettingsReplicationModeglobalTableSettingsReplicationModeGlobalTableSettingsReplicationModeGlobalTableSettingsReplicationModeGlobalTableSettingsReplicationModeGlobalTableSettingsReplicationModeGlobalTableSettingsReplicationMode= GlobalTableSettingsReplicationMo…#
Controls whether table settings are synchronized across replicas.
notes · default

When set to ALL, synchronizable settings (billing mode, throughput, TTL, streams view type, GSIs) are automatically replicated across all replicas. When set to NONE, each replica manages its own settings independently (billing mode must be PAY_PER_REQUEST).

Note: Some settings are always synchronized (key schema, LSIs) regardless of this setting, and some are never synchronized (table class, SSE, deletion protection, PITR, tags, resource policy).

Default: GlobalTableSettingsReplicationMode.NONE

kinesisStreamIStreamkinesis_streamIStreamkinesisStreamIStreamKinesisStreamIStreamKinesisStreamIStream= no Kinesis Data Stream#
Kinesis Data Stream to capture item level changes.
localSecondaryIndexesLocalSecondaryIndexProps[]local_secondary_indexestyping.List[LocalSecondaryIndexProps]localSecondaryIndexesList<LocalSecondaryIndexProps>LocalSecondaryIndexesLocalSecondaryIndexProps[]LocalSecondaryIndexes*[]LocalSecondaryIndexProps= no local secondary indexes#
Local secondary indexes.

Note: You can only provide a maximum of 5 local secondary indexes.

multiRegionConsistencyMultiRegionConsistencymulti_region_consistencyMultiRegionConsistencymultiRegionConsistencyMultiRegionConsistencyMultiRegionConsistencyMultiRegionConsistencyMultiRegionConsistencyMultiRegionConsistency= MultiRegionConsistency.EVENTUAL#
Specifies the consistency mode for a new global table.
partitionKeyAttributepartition_keyAttributepartitionKeyAttributePartitionKeyAttributePartitionKeyAttributerequired#
Partition key attribute definition.
pointInTimeRecoverybooleanpoint_in_time_recoveryboolpointInTimeRecoveryBooleanPointInTimeRecoveryboolPointInTimeRecovery*bool= false - point in time recovery i…deprecated#
use `pointInTimeRecoverySpecification` instead
default

Default: false - point in time recovery is not enabled.

pointInTimeRecoverySpecificationPointInTimeRecoverySpecificationpoint_in_time_recovery_specificationPointInTimeRecoverySpecificationpointInTimeRecoverySpecificationPointInTimeRecoverySpecificationPointInTimeRecoverySpecificationPointInTimeRecoverySpecificationPointInTimeRecoverySpecificationPointInTimeRecoverySpecification= point in time recovery is not en…#
Whether point-in-time recovery is enabled and recoveryPeriodInDays is set.
default

Default: point in time recovery is not enabled.

removalPolicyRemovalPolicyremoval_policyRemovalPolicyremovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicy= RemovalPolicy.RETAIN#
The removal policy applied to the table.
replicasReplicaTableProps[]replicastyping.List[ReplicaTableProps]replicasList<ReplicaTableProps>ReplicasReplicaTableProps[]Replicas*[]ReplicaTableProps= no replica tables#
Replica tables to deploy with the primary table.
notes

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.

resourcePolicyPolicyDocumentresource_policyPolicyDocumentresourcePolicyPolicyDocumentResourcePolicyPolicyDocumentResourcePolicyPolicyDocument= No resource policy statements ar…#
Resource policy to assign to DynamoDB Table.
default

Default: No resource policy statements are added to the created table.

sortKeyAttributesort_keyAttributesortKeyAttributeSortKeyAttributeSortKeyAttribute= no sort key#
Sort key attribute definition.
streamResourcePolicyPolicyDocumentstream_resource_policyPolicyDocumentstreamResourcePolicyPolicyDocumentStreamResourcePolicyPolicyDocumentStreamResourcePolicyPolicyDocument= No resource policy statements ar…#
Resource policy to assign to DynamoDB Stream.
default

Default: No resource policy statements are added to the stream.

tableClassTableClasstable_classTableClasstableClassTableClassTableClassTableClassTableClassTableClass= TableClass.STANDARD#
The table class.
tableNamestringtable_namestrtableNameStringTableNamestringTableName*string= generated by CloudFormation#
The name of the table.
tagsCfnTag[]tagstyping.List[CfnTag]tagsList<CfnTag>TagsCfnTag[]Tags*[]CfnTag= no tags#
Tags to be applied to the primary table (default replica table).
timeToLiveAttributestringtime_to_live_attributestrtimeToLiveAttributeStringTimeToLiveAttributestringTimeToLiveAttribute*string= TTL is disabled#
The name of the TTL attribute.
warmThroughputWarmThroughputwarm_throughputWarmThroughputwarmThroughputWarmThroughputWarmThroughputWarmThroughputWarmThroughputWarmThroughput= no warm throughput is configured#
The warm throughput configuration for the table.
witnessRegionstringwitness_regionstrwitnessRegionStringWitnessRegionstringWitnessRegion*string= no witness region#
The witness Region for the MRSC global table.
notes

A MRSC global table can be configured with either three replicas, or with two replicas and one witness.

Note: Witness region cannot be specified for a Multi-Region Eventual Consistency (MREC) Global Table. Witness regions are only supported for Multi-Region Strong Consistency (MRSC) Global Tables.

Properties ​

encryptionKeyIKeyencryption_keyIKeyencryptionKeyIKeyEncryptionKeyIKeyEncryptionKeyIKey#
The KMS encryption key for the table.
The environment this resource belongs to.
notes

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.

grantsTableGrantsgrantsTableGrantsgrantsTableGrantsGrantsTableGrantsGrantsTableGrantsrequired#
Grants for this table.
nodeNodenodeNodenodeNodeNodeNodeNodeNoderequired#
The tree node.
PROPERTY_INJECTION_IDstringproperty_injection_idstrPROPERTY_INJECTION_IDStringPROPERTY_INJECTION_IDstringPROPERTY_INJECTION_ID*stringrequiredstatic#
Uniquely identifies this class.
resourcePolicyPolicyDocumentresource_policyPolicyDocumentresourcePolicyPolicyDocumentResourcePolicyPolicyDocumentResourcePolicyPolicyDocument#
The resource policy for the table.
stackStackstackStackstackStackStackStackStackStackrequired#
The stack in which this resource is defined.
streamResourcePolicyPolicyDocumentstream_resource_policyPolicyDocumentstreamResourcePolicyPolicyDocumentStreamResourcePolicyPolicyDocumentStreamResourcePolicyPolicyDocument#
Resource policy associated with this table's stream.
tableArnstringtable_arnstrtableArnStringTableArnstringTableArn*stringrequired#
The ARN of the table.
tableIdstringtable_idstrtableIdStringTableIdstringTableId*string#
The ID of the table.
tableNamestringtable_namestrtableNameStringTableNamestringTableName*stringrequired#
The name of the table.
tableRefTableReferencetable_refTableReferencetableRefTableReferenceTableRefTableReferenceTableRefTableReferencerequired#
A reference to this table.
tableStreamArnstringtable_stream_arnstrtableStreamArnStringTableStreamArnstringTableStreamArn*string#
The stream ARN of the table.

Methods ​

addGlobalSecondaryIndex(props: GlobalSecondaryIndexPropsV2): voiddef add_global_secondary_index(self, props: GlobalSecondaryIndexPropsV2) -> Nonepublic void addGlobalSecondaryIndex(GlobalSecondaryIndexPropsV2 props)public void AddGlobalSecondaryIndex(GlobalSecondaryIndexPropsV2 props)func AddGlobalSecondaryIndex(Props GlobalSecondaryIndexPropsV2)#
Add a global secondary index to the table.

Note: Global secondary indexes will be inherited by all replica tables.

1 parameter

Parameters

  • propspropspropspropsProps — the properties of the global secondary index.
addLocalSecondaryIndex(props: LocalSecondaryIndexProps): voiddef add_local_secondary_index(self, props: LocalSecondaryIndexProps) -> Nonepublic void addLocalSecondaryIndex(LocalSecondaryIndexProps props)public void AddLocalSecondaryIndex(LocalSecondaryIndexProps props)func AddLocalSecondaryIndex(Props LocalSecondaryIndexProps)#
Add a local secondary index to the table.

Note: Local secondary indexes will be inherited by all replica tables.

1 parameter

Parameters

  • propspropspropspropsProps — the properties of the local secondary index.
addReplica(props: ReplicaTableProps): voiddef add_replica(self, props: ReplicaTableProps) -> Nonepublic void addReplica(ReplicaTableProps props)public void AddReplica(ReplicaTableProps props)func AddReplica(Props ReplicaTableProps)#
Add a replica table.

Note: Adding a replica table will allow you to use your table as a global table.

1 parameter

Parameters

  • propspropspropspropsProps — the properties of the replica table to add.
addToResourcePolicy(statement: PolicyStatement): AddToResourcePolicyResultdef add_to_resource_policy(self, statement: PolicyStatement) -> AddToResourcePolicyResultpublic AddToResourcePolicyResult addToResourcePolicy(PolicyStatement statement)public AddToResourcePolicyResult AddToResourcePolicy(PolicyStatement statement)func AddToResourcePolicy(Statement PolicyStatement) AddToResourcePolicyResult#
Adds a statement to the resource policy associated with this table.

A resource policy will be automatically created upon the first call to addToResourcePolicy.

Note that this does not work with imported tables.

1 parameter

Parameters

  • statementstatementstatementstatementStatement — The policy statement to add.
addToStreamResourcePolicy(statement: PolicyStatement): AddToResourcePolicyResultdef add_to_stream_resource_policy(self, statement: PolicyStatement) -> AddToResourcePolicyResultpublic AddToResourcePolicyResult addToStreamResourcePolicy(PolicyStatement statement)public AddToResourcePolicyResult AddToStreamResourcePolicy(PolicyStatement statement)func AddToStreamResourcePolicy(Statement PolicyStatement) AddToResourcePolicyResult#
Adds a statement to the resource policy associated with this table's stream.

A stream resource policy will be automatically created upon the first call to addToStreamResourcePolicy.

Note that this does not work with imported tables.

1 parameter

Parameters

  • statementstatementstatementstatementStatement — The policy statement to add.
applyCrossStackReferenceStrength(strength: ReferenceStrength): voiddef apply_cross_stack_reference_strength(self, strength: ReferenceStrength) -> Nonepublic void applyCrossStackReferenceStrength(ReferenceStrength strength)public void ApplyCrossStackReferenceStrength(ReferenceStrength strength)func ApplyCrossStackReferenceStrength(Strength ReferenceStrength)#
Override the cross-stack reference strength for this resource.
notes · 1 parameter

When set, any cross-stack reference to this resource will use the specified mechanism instead of the global default determined by the @aws-cdk/core:defaultCrossStackReferences context key. This is useful for selectively weakening specific references to avoid the "deadly embrace" problem without changing the app-wide default.

Parameters

  • strengthstrengthstrengthstrengthStrength — - The reference strength to use for this resource.
applyRemovalPolicy(policy: RemovalPolicy): voiddef apply_removal_policy(self, policy: RemovalPolicy) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy)public void ApplyRemovalPolicy(RemovalPolicy policy)func ApplyRemovalPolicy(Policy RemovalPolicy)#
Apply the given removal policy to this resource.
notes

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).

fromTableArn(scope: Construct, id: string, tableArn: string): ITableV2@staticmethod def from_table_arn(scope: Construct, id: str, table_arn: str) -> ITableV2public static ITableV2 fromTableArn(Construct scope, String id, String tableArn)public static ITableV2 FromTableArn(Construct scope, string id, string tableArn)func FromTableArn(Scope Construct, Id *string, TableArn *string) ITableV2static#
Creates a Table construct that represents an external table via table ARN.
3 parameters

Parameters

  • scopescopescopescopeScope — the parent creating construct (usually this).
  • ididididId — the construct's name.
  • tableArntable_arntableArntableArnTableArn — the table's ARN.
fromTableAttributes(scope: Construct, id: string, attrs: TableAttributesV2): ITableV2@staticmethod def from_table_attributes(scope: Construct, id: str, attrs: TableAttributesV2) -> ITableV2public static ITableV2 fromTableAttributes(Construct scope, String id, TableAttributesV2 attrs)public static ITableV2 FromTableAttributes(Construct scope, string id, TableAttributesV2 attrs)func FromTableAttributes(Scope Construct, Id *string, Attrs TableAttributesV2) ITableV2static#
Creates a Table construct that represents an external table.
3 parameters

Parameters

  • scopescopescopescopeScope — the parent creating construct (usually this).
  • ididididId — the construct's name.
  • attrsattrsattrsattrsAttrs — attributes of the table.
fromTableName(scope: Construct, id: string, tableName: string): ITableV2@staticmethod def from_table_name(scope: Construct, id: str, table_name: str) -> ITableV2public static ITableV2 fromTableName(Construct scope, String id, String tableName)public static ITableV2 FromTableName(Construct scope, string id, string tableName)func FromTableName(Scope Construct, Id *string, TableName *string) ITableV2static#
Creates a Table construct that represents an external table via table name.
3 parameters

Parameters

  • scopescopescopescopeScope — the parent creating construct (usually this).
  • ididididId — the construct's name.
  • tableNametable_nametableNametableNameTableName — the table's name.
grant(grantee: IGrantable, ...actions: string[]): Grantdef grant(self, grantee: IGrantable, actions: str) -> Grantpublic Grant grant(IGrantable grantee, String actions)public Grant Grant(IGrantable grantee, string actions)func Grant(Grantee IGrantable, Actions *string) 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.

[disable-awslint:no-grants]

2 parameters

Parameters

  • granteegranteegranteegranteeGrantee — the principal (no-op if undefined).
  • actionsactionsactionsactionsActions — the set of actions to allow (i.e., 'dynamodb:PutItem', 'dynamodb:GetItem', etc.).
grantFullAccess(grantee: IGrantable): Grantdef grant_full_access(self, grantee: IGrantable) -> Grantpublic Grant grantFullAccess(IGrantable grantee)public Grant GrantFullAccess(IGrantable grantee)func GrantFullAccess(Grantee IGrantable) 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.

[disable-awslint:no-grants]

1 parameter

Parameters

  • granteegranteegranteegranteeGrantee — the principal to grant access to.
grantOnKey(grantee: IGrantable, ...actions: string[]): GrantOnKeyResultdef grant_on_key(self, grantee: IGrantable, actions: str) -> GrantOnKeyResultpublic GrantOnKeyResult grantOnKey(IGrantable grantee, String actions)public GrantOnKeyResult GrantOnKey(IGrantable grantee, string actions)func GrantOnKey(Grantee IGrantable, Actions *string) GrantOnKeyResult#
Grants permissions on the table's encryption key.
2 parameters

Parameters

  • granteegranteegranteegranteeGrantee — the principal to grant access to.
  • actionsactionsactionsactionsActions — the KMS actions to grant.
grantReadData(grantee: IGrantable): Grantdef grant_read_data(self, grantee: IGrantable) -> Grantpublic Grant grantReadData(IGrantable grantee)public Grant GrantReadData(IGrantable grantee)func GrantReadData(Grantee IGrantable) Grant#
Permits an IAM principal all data read operations on this table.
notes · 1 parameter

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.

[disable-awslint:no-grants]

Parameters

  • granteegranteegranteegranteeGrantee — the principal to grant access to.
grantReadWriteData(grantee: IGrantable): Grantdef grant_read_write_data(self, grantee: IGrantable) -> Grantpublic Grant grantReadWriteData(IGrantable grantee)public Grant GrantReadWriteData(IGrantable grantee)func GrantReadWriteData(Grantee IGrantable) Grant#
Permits an IAM principal to all data read/write operations on this table.
notes · 1 parameter

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.

[disable-awslint:no-grants]

Parameters

  • granteegranteegranteegranteeGrantee — the principal to grant access to.
grantStream(grantee: IGrantable, ...actions: string[]): Grantdef grant_stream(self, grantee: IGrantable, actions: str) -> Grantpublic Grant grantStream(IGrantable grantee, String actions)public Grant GrantStream(IGrantable grantee, string actions)func GrantStream(Grantee IGrantable, Actions *string) 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.

[disable-awslint:no-grants]

2 parameters

Parameters

  • granteegranteegranteegranteeGrantee — the principal (no-op if undefined).
  • actionsactionsactionsactionsActions — the set of actions to allow (i.e., 'dynamodb:DescribeStream', 'dynamodb:GetRecords', etc.).
grantStreamRead(grantee: IGrantable): Grantdef grant_stream_read(self, grantee: IGrantable) -> Grantpublic Grant grantStreamRead(IGrantable grantee)public Grant GrantStreamRead(IGrantable grantee)func GrantStreamRead(Grantee IGrantable) 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.

[disable-awslint:no-grants]

1 parameter

Parameters

  • granteegranteegranteegranteeGrantee — the principal to grant access to.
grantTableListStreams(grantee: IGrantable): Grantdef grant_table_list_streams(self, grantee: IGrantable) -> Grantpublic Grant grantTableListStreams(IGrantable grantee)public Grant GrantTableListStreams(IGrantable grantee)func GrantTableListStreams(Grantee IGrantable) Grant#
Permits an IAM principal to list streams attached to this table.

[disable-awslint:no-grants]

1 parameter

Parameters

  • granteegranteegranteegranteeGrantee — the principal to grant access to.
grantWriteData(grantee: IGrantable): Grantdef grant_write_data(self, grantee: IGrantable) -> Grantpublic Grant grantWriteData(IGrantable grantee)public Grant GrantWriteData(IGrantable grantee)func GrantWriteData(Grantee IGrantable) 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.

[disable-awslint:no-grants]

1 parameter

Parameters

  • granteegranteegranteegranteeGrantee — the principal to grant access to.
isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#
Checks if `x` is a construct.
notes · 1 parameter · returns

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.

Parameters

  • xxxxX — Any object.

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

isOwnedResource(construct: IConstruct): boolean@staticmethod def is_owned_resource(construct: IConstruct) -> boolpublic static Boolean isOwnedResource(IConstruct construct)public static bool IsOwnedResource(IConstruct construct)func IsOwnedResource(Construct IConstruct) *boolstatic#
Returns true if the construct was created by CDK, and false otherwise.
isResource(construct: IConstruct): boolean@staticmethod def is_resource(construct: IConstruct) -> boolpublic static Boolean isResource(IConstruct construct)public static bool IsResource(IConstruct construct)func IsResource(Construct IConstruct) *boolstatic#
Check whether the given construct is a Resource.
metric(metricName: string, props?: MetricOptions): Metricdef metric(self, metric_name: str, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metric(String metricName, MetricOptions props)public Metric Metric(string metricName, MetricOptions? props = null)func Metric(MetricName *string, Props MetricOptions) Metric#
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.

metricConditionalCheckFailedRequests(props?: MetricOptions): Metricdef metric_conditional_check_failed_requests(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricConditionalCheckFailedRequests(MetricOptions props)public Metric MetricConditionalCheckFailedRequests(MetricOptions? props = null)func MetricConditionalCheckFailedRequests(Props MetricOptions) 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.

metricConsumedReadCapacityUnits(props?: MetricOptions): Metricdef metric_consumed_read_capacity_units(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricConsumedReadCapacityUnits(MetricOptions props)public Metric MetricConsumedReadCapacityUnits(MetricOptions? props = null)func MetricConsumedReadCapacityUnits(Props MetricOptions) 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.

metricConsumedWriteCapacityUnits(props?: MetricOptions): Metricdef metric_consumed_write_capacity_units(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricConsumedWriteCapacityUnits(MetricOptions props)public Metric MetricConsumedWriteCapacityUnits(MetricOptions? props = null)func MetricConsumedWriteCapacityUnits(Props MetricOptions) 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.

metricSuccessfulRequestLatency(props?: MetricOptions): Metricdef metric_successful_request_latency(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricSuccessfulRequestLatency(MetricOptions props)public Metric MetricSuccessfulRequestLatency(MetricOptions? props = null)func MetricSuccessfulRequestLatency(Props MetricOptions) 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.

metricSystemErrors(props?: MetricOptions): Metricdef metric_system_errors(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricSystemErrors(MetricOptions props)public Metric MetricSystemErrors(MetricOptions? props = null)func MetricSystemErrors(Props MetricOptions) Metricdeprecated#
use `metricSystemErrorsForOperations`.
metricSystemErrorsForOperations(props?: SystemErrorsForOperationsMetricOptions): IMetricdef metric_system_errors_for_operations(self, props: typing.Optional[SystemErrorsForOperationsMetricOptions] = None) -> IMetricpublic IMetric metricSystemErrorsForOperations(SystemErrorsForOperationsMetricOptions props)public IMetric MetricSystemErrorsForOperations(SystemErrorsForOperationsMetricOptions? props = null)func MetricSystemErrorsForOperations(Props SystemErrorsForOperationsMetricOptions) IMetric#
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.

metricThrottledRequests(props?: MetricOptions): Metricdef metric_throttled_requests(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricThrottledRequests(MetricOptions props)public Metric MetricThrottledRequests(MetricOptions? props = null)func MetricThrottledRequests(Props MetricOptions) Metricdeprecated#
Do not use this function. It returns an invalid metric. Use `metricThrottledRequestsForOperation` instead.

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.

metricThrottledRequestsForOperation(operation: string, props?: OperationsMetricOptions): IMetricdef metric_throttled_requests_for_operation(self, operation: str, props: typing.Optional[OperationsMetricOptions] = None) -> IMetricpublic IMetric metricThrottledRequestsForOperation(String operation, OperationsMetricOptions props)public IMetric MetricThrottledRequestsForOperation(string operation, OperationsMetricOptions? props = null)func MetricThrottledRequestsForOperation(Operation *string, Props OperationsMetricOptions) IMetric#
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.

metricThrottledRequestsForOperations(props?: OperationsMetricOptions): IMetricdef metric_throttled_requests_for_operations(self, props: typing.Optional[OperationsMetricOptions] = None) -> IMetricpublic IMetric metricThrottledRequestsForOperations(OperationsMetricOptions props)public IMetric MetricThrottledRequestsForOperations(OperationsMetricOptions? props = null)func MetricThrottledRequestsForOperations(Props OperationsMetricOptions) 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.

metricUserErrors(props?: MetricOptions): Metricdef metric_user_errors(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricUserErrors(MetricOptions props)public Metric MetricUserErrors(MetricOptions? props = null)func MetricUserErrors(Props MetricOptions) Metric#
Metric for the user errors for this table.
notes

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.

replica(region: string): ITableV2def replica(self, region: str) -> ITableV2public ITableV2 replica(String region)public ITableV2 Replica(string region)func Replica(Region *string) ITableV2#
Retrieve a replica table.

Note: Replica tables are not supported in a region agnostic stack.

1 parameter

Parameters

  • regionregionregionregionRegion — the region of the replica table.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#
Returns a string representation of this construct.
with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#
Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.