Skip to the content.

DynamoAutoscaler

Auto-generated documentation for dynamo_query.dynamo_autoscaler module.

Helper that handles registration and deregistration of auto scaling for DynamoDB tables and indexes.

DynamoAutoscaler

[find in source code]

class DynamoAutoscaler():
    def __init__(
        client: ApplicationAutoScalingClient,
        logger: Optional[logging.Logger] = None,
    ) -> None:

Helper that handles registration and deregistration of auto scaling for DynamoDB tables and indexes.

Arguments

See also

DynamoAutoscaler.create_scaling_policy_configs

[find in source code]

@staticmethod
def create_scaling_policy_configs(
    metric_type: MetricTypeTypeDef,
    target_value: float = SCALE_TARGET_VALUE,
    scale_out_cooldown: int = SCALE_OUT_COOLDOWN,
    scale_in_cooldown: int = SCALE_IN_COOLDOWN,
) -> TargetTrackingScalingPolicyConfigurationTypeDef:

Create auto scaling policy dict.

Arguments

Returns

Scaling policy configs to use in put_scaling_policy

See also

DynamoAutoscaler().deregister_auto_scaling

[find in source code]

def deregister_auto_scaling(
    table_name: str,
    global_secondary_indexes: Iterable[DynamoTableIndex] = (),
) -> None:

Deregister auto scaling for table.

Arguments

DynamoAutoscaler().deregister_scalable_target

[find in source code]

def deregister_scalable_target(
    table_name: str,
    scalable_dimension: ScalableDimensionTypeDef,
    index_name: Optional[str] = None,
) -> None:

Deregister scalable table or index.

Arguments

See also

DynamoAutoscaler().put_scaling_policy

[find in source code]

def put_scaling_policy(
    table_name: str,
    scalable_dimension: ScalableDimensionTypeDef,
    scaling_policy_configs: TargetTrackingScalingPolicyConfigurationTypeDef,
    index_name: Optional[str] = None,
) -> None:

Add scaling policy for table or for index.

Arguments

See also

DynamoAutoscaler().register_auto_scaling

[find in source code]

def register_auto_scaling(
    table_name: str,
    global_secondary_indexes: Iterable[DynamoTableIndex] = (),
    min_capacity: int = SCALE_MIN_CAPACITY,
    max_capacity: int = SCALE_MAX_CAPACITY,
) -> None:

Register auto scaling for table.

Arguments

DynamoAutoscaler().register_scalable_target

[find in source code]

def register_scalable_target(
    table_name: str,
    scalable_dimension: ScalableDimensionTypeDef,
    index_name: Optional[str] = None,
    min_capacity: int = SCALE_MIN_CAPACITY,
    max_capacity: int = SCALE_MAX_CAPACITY,
) -> None:

Register scalable table or index.

Arguments

See also