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();
const stack = new cdk.Stack(app, 'Stack', { env: { region: 'us-west-2' } });
const globalTable = new dynamodb.TableV2(stack, 'GlobalTable', {
partitionKey: { name: 'pk', type: dynamodb.AttributeType.STRING },
// applys to all replicas, i.e., us-west-2, us-east-1, us-east-2
removalPolicy: cdk.RemovalPolicy.DESTROY,
replicas: [
{ region: 'us-east-1' },
{ region: 'us-east-2' },
],
});
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.