Skip to content
v2.273.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 ​

encryptionKeyIKeyencryption_keyIKeyencryptionKeyIKeyEncryptionKeyIKeyEncryptionKeyIKey= no KMS encryption key#
KMS encryption key for the table.
globalIndexesstring[]global_indexestyping.List[str]globalIndexesList<String>GlobalIndexesstring[]GlobalIndexes*[]*string= no global indexes#
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.

grantIndexPermissionsbooleangrant_index_permissionsboolgrantIndexPermissionsBooleanGrantIndexPermissionsboolGrantIndexPermissions*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.

localIndexesstring[]local_indexestyping.List[str]localIndexesList<String>LocalIndexesstring[]LocalIndexes*[]*string= no local indexes#
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.

tableArnstringtable_arnstrtableArnStringTableArnstringTableArn*string= table arn generated using `table…#
The ARN of the table.

Note: You must specify this or the tableName.

default

Default: table arn generated using tableName and region of stack

tableIdstringtable_idstrtableIdStringTableIdstringTableId*string= no table id#
The ID of the table.
tableNamestringtable_namestrtableNameStringTableNamestringTableName*string= table name retrieved from provid…#
The name of the table.

Note: You must specify this or the tableArn.

default

Default: table name retrieved from provided tableArn

tableStreamArnstringtable_stream_arnstrtableStreamArnStringTableStreamArnstringTableStreamArn*string= no table stream ARN#
The stream ARN of the table.