ThroughputProps

class aws_cdk.aws_dynamodb.ThroughputProps(*, read_capacity, write_capacity)

Bases: object

Properties used to configure provisioned throughput for a DynamoDB table.

Parameters:
  • read_capacity (Capacity) – The read capacity.

  • write_capacity (Capacity) – The write capacity.

ExampleMetadata:

infused

Example:

import aws_cdk as cdk


app = cdk.App()
stack = cdk.Stack(app, "Stack", env=cdk.Environment(region="us-west-2"))

global_table = dynamodb.TableV2(stack, "GlobalTable",
    partition_key=dynamodb.Attribute(name="pk", type=dynamodb.AttributeType.STRING),
    billing=dynamodb.Billing.provisioned(
        read_capacity=dynamodb.Capacity.fixed(10),
        write_capacity=dynamodb.Capacity.autoscaled(max_capacity=15)
    ),
    replicas=[dynamodb.ReplicaTableProps(
        region="us-east-1"
    ), dynamodb.ReplicaTableProps(
        region="us-east-2",
        read_capacity=dynamodb.Capacity.autoscaled(max_capacity=20, target_utilization_percent=50)
    )
    ]
)

Attributes

read_capacity

The read capacity.

write_capacity

The write capacity.