# DatabaseClusterEngine

A database cluster engine.

Provides mapping to the serverless application
used for secret rotation.

- Source: [`aws-rds/lib/cluster-engine.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-rds/lib/cluster-engine.ts#L1552)
- Type last changed: v2.165.0 · 31 Oct 2024

## Example

```ts
declare const vpc: ec2.Vpc;
const cluster = new rds.DatabaseCluster(this, 'Database', {
  engine: rds.DatabaseClusterEngine.auroraMysql({ version: rds.AuroraMysqlEngineVersion.VER_3_01_0 }),
  credentials: rds.Credentials.fromGeneratedSecret('clusteradmin'), // Optional - will default to 'admin' username and generated password
  writer: rds.ClusterInstance.provisioned('writer', {
    publiclyAccessible: false,
  }),
  readers: [
    rds.ClusterInstance.provisioned('reader1', { promotionTier: 1 }),
    rds.ClusterInstance.serverlessV2('reader2'),
  ],
  vpcSubnets: {
    subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS,
  },
  vpc,
});
```

## Initializer

```ts
new DatabaseClusterEngine()
```

## Properties

- `AURORA`: [IClusterEngine](/cdk/api/v2/docs/aws-cdk-lib.aws_rds.IClusterEngine.html) (required) (static) — use `AURORA_MYSQL` instead

  **Note**: we do not recommend using unversioned engines for non-serverless Clusters,
    as that can pose an availability risk.
    We recommend using versioned engines created using the `aurora()` method

- `AURORA_MYSQL`: [IClusterEngine](/cdk/api/v2/docs/aws-cdk-lib.aws_rds.IClusterEngine.html) (required) (static) — The unversioned 'aurora-msql' cluster engine.

  **Note**: we do not recommend using unversioned engines for non-serverless Clusters,
    as that can pose an availability risk.
    We recommend using versioned engines created using the `auroraMysql()` method

- `AURORA_POSTGRESQL`: [IClusterEngine](/cdk/api/v2/docs/aws-cdk-lib.aws_rds.IClusterEngine.html) (required) (static) — The unversioned 'aurora-postgresql' cluster engine.

  **Note**: we do not recommend using unversioned engines for non-serverless Clusters,
    as that can pose an availability risk.
    We recommend using versioned engines created using the `auroraPostgres()` method

## Methods

- `aurora(props: AuroraClusterEngineProps): IClusterEngine` (static) — use `auroraMysql()` instead

- `auroraMysql(props: AuroraMysqlClusterEngineProps): IClusterEngine` (static) — Creates a new Aurora MySQL database cluster engine.

- `auroraPostgres(props: AuroraPostgresClusterEngineProps): IClusterEngine` (static) — Creates a new Aurora PostgreSQL database cluster engine.
