Billing
- class aws_cdk.aws_dynamodb.Billing(*args: Any, **kwargs)
Bases:
object
Represents how capacity is managed and how you are charged for read and write throughput for a DynamoDB table.
- 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
- mode
Static Methods
- classmethod on_demand(*, max_read_request_units=None, max_write_request_units=None)
Flexible billing option capable of serving requests without capacity planning.
Note: Billing mode will be PAY_PER_REQUEST.
- Parameters:
max_read_request_units (
Union
[int
,float
,None
]) – The max read request units. Default: - if table mode is on-demand and this property is undefined, no maximum throughput limit will be put in place for read requests. This property is only applicable for tables using on-demand mode.max_write_request_units (
Union
[int
,float
,None
]) – The max write request units. Default: - if table mode is on-demand and this property is undefined, no maximum throughput limit will be put in place for write requests. This property is only applicable for tables using on-demand mode.
- Return type: