Creating a DB cluster that uses Aurora Serverless v2 - Amazon Aurora
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Creating a DB cluster that uses Aurora Serverless v2

To create an Aurora cluster where you can add Aurora Serverless v2 DB instances, you follow the same procedure as in Creating an Amazon Aurora DB cluster. With Aurora Serverless v2, your clusters are interchangeable with provisioned clusters. You can have clusters where some DB instances use Aurora Serverless v2 and some DB instances are provisioned.

Settings for Aurora Serverless v2 DB clusters

Make sure that the cluster's initial settings meet the requirements listed in Requirements and limitations for Aurora Serverless v2. Specify the following settings to make sure that you can add Aurora Serverless v2 DB instances to the cluster:

Amazon Web Services Region

Create the cluster in an Amazon Web Services Region where Aurora Serverless v2 DB instances are available. For details about available Regions, see Aurora Serverless v2.

DB engine version

Choose an engine version that's compatible with Aurora Serverless v2. For information about the Aurora Serverless v2 version requirements, see Requirements and limitations for Aurora Serverless v2.

DB instance class

If you create a cluster using the Amazon Web Services Management Console, you choose the DB instance class for the writer DB instance at the same time. Choose the Serverless DB instance class. When you choose that DB instance class, you also specify the capacity range for the writer DB instance. That same capacity range applies to all other Aurora Serverless v2 DB instances that you add to that cluster.

If you don't see the Serverless choice for the DB instance class, make sure that you chose a DB engine version that's supported for Aurora Serverless v2.

When you use the Amazon CLI or the Amazon RDS API, the parameter that you specify for the DB instance class is db.serverless.

Capacity range

Fill in the minimum and maximum Aurora capacity unit (ACU) values that apply to all the DB instances in the cluster. This option is available on both the Create cluster and Add reader console pages when you choose Serverless for the DB instance class.

If you don't see the minimum and maximum ACU fields, make sure that you chose the Serverless DB instance class for the writer DB instance.

If you initially create the cluster with a provisioned DB instance, you don't specify the minimum and maximum ACUs. In that case you can modify the cluster afterward to add that setting. You can also add an Aurora Serverless v2 reader DB instance to the cluster. You specify the capacity range as part of that process.

Until you specify the capacity range for your cluster, you can't add any Aurora Serverless v2 DB instances to the cluster using the Amazon CLI or RDS API. If you try to add a Aurora Serverless v2 DB instance, you get an error. In the Amazon CLI or the RDS API procedures, the capacity range is represented by the ServerlessV2ScalingConfiguration attribute.

For clusters containing more than one reader DB instance, the failover priority of each Aurora Serverless v2 reader DB instance plays an important part in how that DB instance scales up and down. You can't specify the priority when you initially create the cluster. Keep this property in mind when you add a second or later reader DB instance to your cluster. For more information, see Choosing the promotion tier for an Aurora Serverless v2 reader.

Creating an Aurora Serverless v2 DB cluster

You can use the Amazon Web Services Management Console, Amazon CLI, or RDS API to create an Aurora Serverless v2 DB cluster.

To create a cluster with an Aurora Serverless v2 writer
  1. Sign in to the Amazon Web Services Management Console and open the Amazon RDS console at https://console.amazonaws.cn/rds/.

  2. In the navigation pane, choose Databases.

  3. Choose Create database. On the page that appears, choose the following options:

    • For Engine type, choose Aurora (MySQL Compatible) or Aurora (PostgreSQL Compatible).

    • For Version, choose one of the supported versions for Aurora Serverless v2.

  4. For DB instance class, select Serverless v2.

  5. For Capacity range, you can accept the default range. Or you can choose other values for minimum and maximum capacity units. You can choose from 0.5 ACUs minimum through 128 ACUs maximum, in increments of 0.5 ACU.

    For more information about Aurora Serverless v2 capacity units, see Aurora Serverless v2 capacity and Performance and scaling for Aurora Serverless v2.

    
                                Instance configuration settings for Aurora Serverless v2.
  6. Choose any other DB cluster settings, as described in Settings for Aurora DB clusters.

  7. Choose Create database to create your Aurora DB cluster with an Aurora Serverless v2 DB instance as the writer instance, also known as the primary DB instance.

To create a DB cluster that's compatible with Aurora Serverless v2 DB instances using the Amazon CLI, you follow the CLI procedure in Creating an Amazon Aurora DB cluster. Include the following parameters in your create-db-cluster command:

  • --region AWS_Region_where_Aurora Serverless v2_instances_are_available

  • --engine-version serverless_v2_compatible_engine_version

  • --serverless-v2-scaling-configuration MinCapacity=minimum_capacity,MaxCapacity=maximum_capacity

The following example shows the creation of an Aurora Serverless v2 DB cluster.

aws rds create-db-cluster \ --db-cluster-identifier my-serverless-v2-cluster \ --region eu-central-1 \ --engine aurora-mysql \ --engine-version 8.0.mysql_aurora.3.04.1 \ --serverless-v2-scaling-configuration MinCapacity=1,MaxCapacity=4 \ --master-username myuser \ --manage-master-user-password
Note

When you create an Aurora Serverless v2 DB cluster using the Amazon CLI, the engine mode appears in the output as provisioned rather than serverless. The serverless engine mode refers to Aurora Serverless v1.

This example specifies the --manage-master-user-password option to generate the master user password and manage it in Secrets Manager. For more information, see Password management with Amazon Aurora and Amazon Secrets Manager. Alternatively, you can use the --master-password option to specify and manage the password yourself.

For information about the Aurora Serverless v2 version requirements, see Requirements and limitations for Aurora Serverless v2. For information about the allowed numbers for the capacity range and what those numbers represent, see Aurora Serverless v2 capacity and Performance and scaling for Aurora Serverless v2.

To verify whether an existing cluster has the capacity settings specified, check the output of the describe-db-clusters command for the ServerlessV2ScalingConfiguration attribute. Thatattribute looks similar to the following.

"ServerlessV2ScalingConfiguration": { "MinCapacity": 1.5, "MaxCapacity": 24.0 }
Tip

If you don't specify the minimum and maximum ACUs when you create the cluster, you can use the modify-db-cluster command afterward to add that setting. Until you do, you can't add any Aurora Serverless v2 DB instances to the cluster. If you try to add a db.serverless DB instance, you get an error.

To create a DB cluster that's compatible with Aurora Serverless v2 DB instances using the RDS API, you follow the API procedure in Creating an Amazon Aurora DB cluster. Choose the following settings. Make sure that your CreateDBCluster operation includes the following parameters:

EngineVersion serverless_v2_compatible_engine_version ServerlessV2ScalingConfiguration with MinCapacity=minimum_capacity and MaxCapacity=maximum_capacity

For information about the Aurora Serverless v2 version requirements, see Requirements and limitations for Aurora Serverless v2. For information about the allowed numbers for the capacity range and what those numbers represent, see Aurora Serverless v2 capacity and Performance and scaling for Aurora Serverless v2.

To check if an existing cluster has the capacity settings specified, check the output of the DescribeDBClusters operation for the ServerlessV2ScalingConfiguration attribute. That attribute looks similar to the following.

"ServerlessV2ScalingConfiguration": { "MinCapacity": 1.5, "MaxCapacity": 24.0 }
Tip

If you don't specify the minimum and maximum ACUs when you create the cluster, you can use the ModifyDBCluster operation afterward to add that setting. Until you do, you can't add any Aurora Serverless v2 DB instances to the cluster. If you try to add a db.serverless DB instance, you get an error.

Creating an Aurora Serverless v2 writer DB instance

When you create a DB cluster using the Amazon Web Services Management Console, you specify the properties of the writer DB instance at the same time. To make the writer DB instance use Aurora Serverless v2, choose the Serverless DB instance class.

Then you set the capacity range for the cluster by specifying the minimum and maximum Aurora capacity unit (ACU) values. These minimum and maximum values apply to each Aurora Serverless v2 DB instance in the cluster.


                    Instance configuration settings for Aurora Serverless v2.

If you don't create an Aurora Serverless v2 DB instance when you first create the cluster, you can add one or more Aurora Serverless v2 DB instances later. To do so, follow the procedures in Adding an Aurora Serverless v2 reader and Converting a provisioned writer or reader to Aurora Serverless v2. You specify the capacity range at the time that you add the first Aurora Serverless v2 DB instance to the cluster. You can change the capacity range later by following the procedure in Setting the Aurora Serverless v2 capacity range for a cluster.

When you create a Aurora Serverless v2 DB cluster using the Amazon CLI, you explicitly add the writer DB instance using the create-db-instance command. Include the following parameter:

  • --db-instance-class db.serverless

The following example shows the creation of an Aurora Serverless v2 writer DB instance.

aws rds create-db-instance \ --db-cluster-identifier my-serverless-v2-cluster \ --db-instance-identifier my-serverless-v2-instance \ --db-instance-class db.serverless \ --engine aurora-mysql