# TableAttributesV2

Attributes of a DynamoDB table.

- Source: [`aws-dynamodb/lib/table-v2.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-dynamodb/lib/table-v2.ts#L533)
- Type last changed: v2.95.0 · 7 Sep 2023

## 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

- `encryptionKey`: [IKey](/cdk/api/v2/docs/aws-cdk-lib.aws_kms.IKey.html) — KMS encryption key for the table.

  **Default:** no KMS encryption key

- `globalIndexes`: 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.

- `grantIndexPermissions`: boolean = 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.

- `localIndexes`: 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.

- `tableArn`: string — The ARN of the table.

  **Default:** table arn generated using `tableName` and region of stack

  Note: You must specify this or the `tableName`.

- `tableId`: string — The ID of the table.

  **Default:** no table id

- `tableName`: string — The name of the table.

  **Default:** table name retrieved from provided `tableArn`

  Note: You must specify this or the `tableArn`.

- `tableStreamArn`: string — The stream ARN of the table.

  **Default:** no table stream ARN
