Attribute Struct
Represents an attribute for describing the key schema for the table and indexes.
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
The name of an attribute.
The data type of an attribute.