AutoscaledCapacityOptions
- class aws_cdk.aws_dynamodb.AutoscaledCapacityOptions(*, max_capacity, min_capacity=None, seed_capacity=None, target_utilization_percent=None)
Bases:
object
Options used to configure autoscaled capacity.
- Parameters:
max_capacity (
Union
[int
,float
]) – The maximum allowable capacity.min_capacity (
Union
[int
,float
,None
]) – The minimum allowable capacity. Default: 1seed_capacity (
Union
[int
,float
,None
]) – If you want to switch a table’s billing mode from on-demand to provisioned or from provisioned to on-demand, you must specify a value for this property for each autoscaled resource. Default: no seed capacitytarget_utilization_percent (
Union
[int
,float
,None
]) – The ratio of consumed capacity units to provisioned capacity units. Note: Target utilization percent cannot be less than 20 and cannot be greater than 90. Default: 70
- 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
- max_capacity
The maximum allowable capacity.
- min_capacity
The minimum allowable capacity.
- Default:
1
- seed_capacity
If you want to switch a table’s billing mode from on-demand to provisioned or from provisioned to on-demand, you must specify a value for this property for each autoscaled resource.
- Default:
no seed capacity
- target_utilization_percent
The ratio of consumed capacity units to provisioned capacity units.
Note: Target utilization percent cannot be less than 20 and cannot be greater than 90.
- Default:
70