# AttributeType

Data types for attributes within a table.

- Source: [`aws-dynamodb/lib/shared.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-dynamodb/lib/shared.ts#L132)

## Example

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

const app = new cdk.App();

// Source table in Account A
const sourceStack = new cdk.Stack(app, 'SourceStack', {
  env: { region: 'us-east-1', account: '111111111111' },
});

// Region us-west-2
const sourceTable = new dynamodb.TableV2(sourceStack, 'SourceTable', {
  tableName: 'MyMultiAccountTable',
  partitionKey: { name: 'pk', type: dynamodb.AttributeType.STRING },
  globalTableSettingsReplicationMode: dynamodb.GlobalTableSettingsReplicationMode.ALL,
});
// After replica is deployed, update source stack with the ARN
sourceTable.grants.multiAccountReplicationTo('arn:aws:dynamodb:us-east-1:222222222222:table/MyMultiAccountTable');
```

## Members

| Member | Description |
| --- | --- |
| `BINARY` | Up to 400KiB of binary data (which must be encoded as base64 before sending to DynamoDB). |
| `NUMBER` | Numeric values made of up to 38 digits (positive, negative or zero). |
| `STRING` | Up to 400KiB of UTF-8 encoded text. |

## Referenced by

- [`Attribute`](/v2/docs/aws-cdk-lib.aws_dynamodb.Attribute).type
