# ServerlessScalingOptions

Options for configuring scaling on an Aurora Serverless v1 Cluster.

- Source: [`aws-rds/lib/serverless-cluster.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-rds/lib/serverless-cluster.ts#L291)
- Type last changed: v2.118.0 · 3 Jan 2024

## Example

```ts
declare const vpc: ec2.Vpc;

const cluster = new rds.ServerlessCluster(this, 'AnotherCluster', {
  engine: rds.DatabaseClusterEngine.AURORA_POSTGRESQL,
  copyTagsToSnapshot: true, // whether to save the cluster tags when creating the snapshot. Default is 'true'
  parameterGroup: rds.ParameterGroup.fromParameterGroupName(this, 'ParameterGroup', 'default.aurora-postgresql11'),
  vpc,
  scaling: {
    autoPause: Duration.minutes(10), // default is to pause after 5 minutes of idle time
    minCapacity: rds.AuroraCapacityUnit.ACU_8, // default is 2 Aurora capacity units (ACUs)
    maxCapacity: rds.AuroraCapacityUnit.ACU_32, // default is 16 Aurora capacity units (ACUs)
    timeout: Duration.seconds(100), // default is 5 minutes
    timeoutAction: rds.TimeoutAction.FORCE_APPLY_CAPACITY_CHANGE // default is ROLLBACK_CAPACITY_CHANGE
  }
});
```

## Properties

- `autoPause`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) — The time before an Aurora Serverless database cluster is paused.

  **Default:** automatic pause enabled after 5 minutes

  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

- `maxCapacity`: [AuroraCapacityUnit](/cdk/api/v2/docs/aws-cdk-lib.aws_rds.AuroraCapacityUnit.html) — The maximum capacity for an Aurora Serverless database cluster.

  **Default:** determined by Aurora based on database engine

- `minCapacity`: [AuroraCapacityUnit](/cdk/api/v2/docs/aws-cdk-lib.aws_rds.AuroraCapacityUnit.html) — The minimum capacity for an Aurora Serverless database cluster.

  **Default:** determined by Aurora based on database engine

- `timeout`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) — 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

- `timeoutAction`: [TimeoutAction](/cdk/api/v2/docs/aws-cdk-lib.aws_rds.TimeoutAction.html) — The action to take when the timeout is reached.

  **Default:** TimeoutAction.ROLLBACK_CAPACITY_CHANGE

  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.
