Skip to content
v2.274.0

TableAttributesV2 Struct ​

Attributes of a DynamoDB table.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_dynamodb as dynamodb } from 'aws-cdk-lib';
import { aws_kms as kms } from 'aws-cdk-lib';

declare const key: kms.Key;
const tableAttributesV2: dynamodb.TableAttributesV2 = {
  encryptionKey: key,
  globalIndexes: ['globalIndexes'],
  grantIndexPermissions: false,
  localIndexes: ['localIndexes'],
  tableArn: 'tableArn',
  tableId: 'tableId',
  tableName: 'tableName',
  tableStreamArn: 'tableStreamArn',
};

Properties ​

encryptionKeyoptionalIKeyencryption_keyoptionalIKeyencryptionKeyoptionalIKeyEncryptionKeyoptionalIKeyEncryptionKeyoptionalIKey#
KMS encryption key for the table.

Default: no KMS encryption key

globalIndexesoptionalstring[]global_indexesoptionaltyping.List[str]globalIndexesoptionalList<String>GlobalIndexesoptionalstring[]GlobalIndexesoptional*[]*string#
The name of the global indexes set for the table.

Default: no global indexes

Note: You must set either this property or localIndexes if you want permissions to be granted for indexes as well as the table itself.

grantIndexPermissionsoptionalbooleangrant_index_permissionsoptionalboolgrantIndexPermissionsoptionalBooleanGrantIndexPermissionsoptionalboolGrantIndexPermissionsoptional*bool= false#
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.

localIndexesoptionalstring[]local_indexesoptionaltyping.List[str]localIndexesoptionalList<String>LocalIndexesoptionalstring[]LocalIndexesoptional*[]*string#
The name of the local indexes set for the table.

Default: no local indexes

Note: You must set either this property or globalIndexes if you want permissions to be granted for indexes as well as the table itself.

tableArnoptionalstringtable_arnoptionalstrtableArnoptionalStringTableArnoptionalstringTableArnoptional*string#
The ARN of the table.

Default: table arn generated using tableName and region of stack

Note: You must specify this or the tableName.

tableIdoptionalstringtable_idoptionalstrtableIdoptionalStringTableIdoptionalstringTableIdoptional*string#
The ID of the table.

Default: no table id

tableNameoptionalstringtable_nameoptionalstrtableNameoptionalStringTableNameoptionalstringTableNameoptional*string#
The name of the table.

Default: table name retrieved from provided tableArn

Note: You must specify this or the tableArn.

tableStreamArnoptionalstringtable_stream_arnoptionalstrtableStreamArnoptionalStringTableStreamArnoptionalstringTableStreamArnoptional*string#
The stream ARN of the table.

Default: no table stream ARN