interface Attribute
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.DynamoDB.Attribute |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsdynamodb#Attribute |
Java | software.amazon.awscdk.services.dynamodb.Attribute |
Python | aws_cdk.aws_dynamodb.Attribute |
TypeScript (source) | aws-cdk-lib » aws_dynamodb » Attribute |
Represents an attribute for describing the key schema for the table and indexes.
Example
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 | Type | Description |
|---|---|---|
| name | string | The name of an attribute. |
| type | Attribute | The data type of an attribute. |
name
Type:
string
The name of an attribute.
type
Type:
Attribute
The data type of an attribute.

.NET
Go
Java
Python
TypeScript (