ServerlessScalingOptions

class aws_cdk.aws_rds.ServerlessScalingOptions(*, auto_pause=None, max_capacity=None, min_capacity=None, timeout=None, timeout_action=None)

Bases: object

Options for configuring scaling on an Aurora Serverless cluster.

Parameters:
  • auto_pause (Optional[Duration]) – The time before an Aurora Serverless database cluster is paused. A database cluster can be paused only when it is idle (it has no connections). Auto pause time must be between 5 minutes and 1 day. If a DB cluster is paused for more than seven days, the DB cluster might be backed up with a snapshot. In this case, the DB cluster is restored when there is a request to connect to it. Set to 0 to disable Default: - automatic pause enabled after 5 minutes

  • max_capacity (Optional[AuroraCapacityUnit]) – The maximum capacity for an Aurora Serverless database cluster. Default: - determined by Aurora based on database engine

  • min_capacity (Optional[AuroraCapacityUnit]) – The minimum capacity for an Aurora Serverless database cluster. Default: - determined by Aurora based on database engine

  • timeout (Optional[Duration]) – The amount of time that Aurora Serverless v1 tries to find a scaling point to perform seamless scaling before enforcing the timeout action. Default: - 5 minutes

  • timeout_action (Optional[TimeoutAction]) – The action to take when the timeout is reached. Selecting ForceApplyCapacityChange will force the capacity to the specified value as soon as possible, even without a scaling point. Selecting RollbackCapacityChange will ignore the capacity change if a scaling point is not found. This is the default behavior. Default: - TimeoutAction.ROLLBACK_CAPACITY_CHANGE

ExampleMetadata:

infused

Example:

# vpc: ec2.Vpc


cluster = rds.ServerlessCluster(self, "AnotherCluster",
    engine=rds.DatabaseClusterEngine.AURORA_POSTGRESQL,
    copy_tags_to_snapshot=True,  # whether to save the cluster tags when creating the snapshot. Default is 'true'
    parameter_group=rds.ParameterGroup.from_parameter_group_name(self, "ParameterGroup", "default.aurora-postgresql11"),
    vpc=vpc,
    scaling=rds.ServerlessScalingOptions(
        auto_pause=Duration.minutes(10),  # default is to pause after 5 minutes of idle time
        min_capacity=rds.AuroraCapacityUnit.ACU_8,  # default is 2 Aurora capacity units (ACUs)
        max_capacity=rds.AuroraCapacityUnit.ACU_32,  # default is 16 Aurora capacity units (ACUs)
        timeout=Duration.seconds(100),  # default is 5 minutes
        timeout_action=rds.TimeoutAction.FORCE_APPLY_CAPACITY_CHANGE
    )
)

Attributes

auto_pause

The time before an Aurora Serverless database cluster is paused.

A database cluster can be paused only when it is idle (it has no connections). Auto pause time must be between 5 minutes and 1 day.

If a DB cluster is paused for more than seven days, the DB cluster might be backed up with a snapshot. In this case, the DB cluster is restored when there is a request to connect to it.

Set to 0 to disable

Default:
  • automatic pause enabled after 5 minutes

max_capacity

The maximum capacity for an Aurora Serverless database cluster.

Default:
  • determined by Aurora based on database engine

min_capacity

The minimum capacity for an Aurora Serverless database cluster.

Default:
  • determined by Aurora based on database engine

timeout

The amount of time that Aurora Serverless v1 tries to find a scaling point to perform seamless scaling before enforcing the timeout action.

Default:
  • 5 minutes

timeout_action

The action to take when the timeout is reached.

Selecting ForceApplyCapacityChange will force the capacity to the specified value as soon as possible, even without a scaling point. Selecting RollbackCapacityChange will ignore the capacity change if a scaling point is not found. This is the default behavior.

Default:
  • TimeoutAction.ROLLBACK_CAPACITY_CHANGE