TableAttributes Struct
Reference to 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 tableAttributes: dynamodb.TableAttributes = {
encryptionKey: key,
globalIndexes: ['globalIndexes'],
grantIndexPermissions: false,
localIndexes: ['localIndexes'],
tableArn: 'tableArn',
tableName: 'tableName',
tableStreamArn: 'tableStreamArn',
};
Properties
encryptionKeyoptionalIKeyencryption_keyoptionalIKeyencryptionKeyoptionalIKeyEncryptionKeyoptionalIKeyEncryptionKeyoptionalIKey#KMS encryption key, if this table uses a customer-managed encryption key.
Default: no key
globalIndexesoptionalstring[]global_indexesoptionaltyping.List[str]globalIndexesoptionalList<String>GlobalIndexesoptionalstring[]GlobalIndexesoptional*[]*string#The name of the global indexes set for this Table.
Default: no global indexes
Note that you need to set either this property, or localIndexes, if you want methods like grantReadData() to grant permissions for indexes as well as the table itself.
grantIndexPermissionsoptionalbooleangrant_index_permissionsoptionalboolgrantIndexPermissionsoptionalBooleanGrantIndexPermissionsoptionalboolGrantIndexPermissionsoptional*bool= false#If set to true, grant methods always grant permissions for all indexes.
If false is provided, grant methods grant the permissions only when globalIndexes or localIndexes is specified.
localIndexesoptionalstring[]local_indexesoptionaltyping.List[str]localIndexesoptionalList<String>LocalIndexesoptionalstring[]LocalIndexesoptional*[]*string#The name of the local indexes set for this Table.
Default: no local indexes
Note that you need to set either this property, or globalIndexes, if you want methods like grantReadData() to grant permissions for indexes as well as the table itself.
tableArnoptionalstringtable_arnoptionalstrtableArnoptionalStringTableArnoptionalstringTableArnoptional*string#The ARN of the dynamodb table.
Default: no table arn
One of this, or tableName, is required.
tableNameoptionalstringtable_nameoptionalstrtableNameoptionalStringTableNameoptionalstringTableNameoptional*string#The table name of the dynamodb table.
Default: no table name
One of this, or tableArn, is required.
tableStreamArnoptionalstringtable_stream_arnoptionalstrtableStreamArnoptionalStringTableStreamArnoptionalstringTableStreamArnoptional*string#The ARN of the table's stream.
Default: no table stream