# Attribute

Represents an attribute for describing the key schema for the table and indexes.

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

## 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');
```

## Properties

- `name`: string (required) — The name of an attribute.

- `type`: [AttributeType](/cdk/api/v2/docs/aws-cdk-lib.aws_dynamodb.AttributeType.html) (required) — The data type of an attribute.
