

# Add member clusters

In this step, you add your Aurora DB clusters to the database cluster group for Aurora as member clusters. Adding a cluster copies no data and doesn't change its endpoints, so its own endpoints keep working. From then on, the group coordinates upgrades in waves, backups and point-in-time restore, and monitoring across its member clusters.

**Topics**
+ [Choosing your starting point](#databaseclustergroups-adopting)
+ [Adding new clusters](#databaseclustergroups-gs-create-new)
+ [Adding clusters that you already run](#databaseclustergroups-gs-add-existing)
+ [Adding a cluster to the group](#databaseclustergroups-getting-started-add-members)

## Choosing your starting point
<a name="databaseclustergroups-adopting"></a>

You can add Aurora DB clusters that you already run, new clusters, or both. Use the following table to find the section for your starting point.


| You want to | Start with | 
| --- | --- | 
| Upgrade, back up, restore, and monitor the clusters that you run today from one group, with no change to how applications connect | [Adding clusters that you already run](#databaseclustergroups-gs-add-existing) | 
| Create new clusters for the group | [Adding new clusters](#databaseclustergroups-gs-create-new) | 
| Add the cluster of a packaged application whose schema and SQL you don't own | [Packaged applications](databaseclustergroups-mapping-levels.md#databaseclustergroups-mapping-levels-packaged-applications) | 
| Manage several clusters that your application or a proxy already splits data across | [Adding clusters that you already run](#databaseclustergroups-gs-add-existing), then [Describing existing data partitions with data mappings](databaseclustergroups-existing-split.md) in Step 4 | 

Every member cluster stays directly reachable through its own endpoints. If you enable routing in Step 4, you choose for each application whether it uses the routing endpoint.

## Adding new clusters
<a name="databaseclustergroups-gs-create-new"></a>

To create each cluster, follow [Creating an Amazon Aurora DB cluster](Aurora.CreateInstance.md). For the group, each new cluster needs the following:
+ The same AWS account and AWS Region as the group, the group's engine, and a supported engine version. For supported versions, see [Limitations and considerations for database cluster groups for Aurora](databaseclustergroups-limitations.md).
+ On Aurora MySQL version 8.4.900, create the cluster without DB instances and add its writer after the cluster joins the group. Member clusters can use provisioned or Aurora Serverless v2 DB instances; an Aurora Serverless v2 minimum capacity of 0 isn't supported.

**Note**  
Add a cluster to the group before you create its DB instances. On Aurora MySQL version 8.4.900, if you create a DB instance before the cluster joins the group, the request fails with an `InvalidDBClusterStateFault` error.

------
#### [ Aurora MySQL ]

Create the cluster with the following command.

```bash
aws rds create-db-cluster --db-cluster-identifier {{sample-cluster}} \
    --engine aurora-mysql --engine-version 8.4.mysql_aurora.8.4.900 \
    --storage-type aurora-iopt1 \
    --master-username {{user-name}} --manage-master-user-password \
    --db-subnet-group-name {{mysubnetgroup}} --vpc-security-group-ids {{sg-c7e5b0d2}}
```

------

Add each cluster to the group, as described in [Adding a cluster to the group](#databaseclustergroups-getting-started-add-members).

## Adding clusters that you already run
<a name="databaseclustergroups-gs-add-existing"></a>

You can add an Aurora DB cluster that runs version 8.4.900 to the group without moving data. On Aurora MySQL version 8.4.900, a DB cluster outside a group has no DB instances. The add restarts nothing and drops no connections. Create the DB instances after the cluster joins.

You can't upgrade an existing DB cluster to version 8.4.900. To bring a DB cluster that runs an earlier Aurora MySQL 8.4 version into the group, restore a snapshot of it onto version 8.4.900. A restore onto 8.4.900 from an earlier major version, such as Aurora MySQL version 3, isn't supported. For more information, see [General limitations](databaseclustergroups-limitations.md#databaseclustergroups-limitations-general). First, create a snapshot of the DB cluster.

```bash
aws rds create-db-cluster-snapshot \
    --db-cluster-identifier {{mydbcluster}} \
    --db-cluster-snapshot-identifier {{mydbclustersnapshot}}
```

Then restore the snapshot onto version 8.4.900.

```bash
aws rds restore-db-cluster-from-snapshot \
    --db-cluster-identifier {{mynewdbcluster}} \
    --snapshot-identifier {{mydbclustersnapshot}} \
    --engine aurora-mysql \
    --engine-version 8.4.mysql_aurora.8.4.900
```

Each cluster keeps its endpoints, parameter group, maintenance window, automated backups, encryption key, and network settings. For more information about the checks to run before a cluster joins, see [Before you add a member cluster](databaseclustergroups-member-clusters.md#databaseclustergroups-gs-before-you-add-a-member-cluster). For more information about packaged applications, see [Packaged applications](databaseclustergroups-mapping-levels.md#databaseclustergroups-mapping-levels-packaged-applications). To add a cluster in place, use the following procedure.

## Adding a cluster to the group
<a name="databaseclustergroups-getting-started-add-members"></a>

Add each cluster to the group, one at a time.

------
#### [ Console ]

**To add a cluster as a member cluster (console)**

1. Sign in to the AWS Management Console and open the Amazon RDS console at [https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/).

1. In the navigation pane, choose **Database cluster groups**, and then choose the group.

1. On the **Member clusters** tab, choose **Add cluster**.

1. Choose **Add clusters**, select the clusters to add, and choose **Add selected clusters**. The console lists only the clusters that run the group's engine.

1. Choose **Next**, review the clusters, and choose **Add cluster**.

1. On the **Member clusters** tab, verify that every cluster appears.

For the checks to run before a cluster joins, and for what changes when it joins, see [Adding a cluster in place](databaseclustergroups-member-clusters.md#databaseclustergroups-gs-adding-a-cluster-in-place).

------
#### [ AWS CLI ]

**To add a cluster as a member cluster (AWS CLI)**

1. With the AWS CLI, run `describe-db-clusters` for the cluster. Check that it runs the group's engine on a supported engine version, in the group's AWS account and AWS Region, and that it isn't a member of another group. A cluster belongs to at most one group.

1. With the AWS CLI, run the following command for one cluster. The command returns before the cluster joins.

   ```bash
   aws rds add-db-cluster-to-db-cluster-group --region {{REGION}} \
       --db-cluster-group-identifier {{GROUP_IDENTIFIER}} \
       --db-cluster-identifier {{CLUSTER_IDENTIFIER}} \
       --db-cluster-group-upgrade-wave {{WAVE}}
   ```

1. To confirm the join, list the group's member clusters with the AWS CLI.

   ```bash
   aws rds describe-db-cluster-groups --region {{REGION}} \
       --db-cluster-group-identifier {{GROUP_IDENTIFIER}} \
       --query 'DBClusterGroups[0].DBClusterGroupMembers'
   ```

1. Repeat these steps for each cluster.

------
#### [ Amazon RDS API ]

Call `DescribeDBClusters` to check the cluster's engine, engine version, account, Region, and group membership. Then call `AddDBClusterToDBClusterGroup` with `DBClusterGroupIdentifier`, `DBClusterIdentifier`, and `DBClusterGroupUpgradeWave`. To confirm the join, call `DescribeDBClusterGroups` and read `DBClusterGroupMembers`. Repeat for each cluster.

------

If the cluster's engine version is earlier than the minimum supported version for its engine, the add request fails with an `InvalidParameterValue` error.

**Note**  
After a cluster joins the group, each DB instance that you create in that cluster comes up as part of the database cluster group for Aurora.

Each member cluster belongs to an upgrade wave. You set it with `--db-cluster-group-upgrade-wave` when you add the cluster, or later with `modify-db-cluster`, and `describe-db-clusters` returns it. A member cluster that you don't assign to a wave is in the first wave. For how waves run, see [Upgrading a database cluster group for Aurora in waves](databaseclustergroups-upgrades.md).

**Result:** The group holds every cluster that you added. Each cluster keeps its data and its endpoints. Create its DB instances after it joins. Upgrades in waves, group backup and restore, and monitoring now cover every member cluster. To take a cluster out of the group later, see [Removing a member cluster](databaseclustergroups-member-clusters.md#databaseclustergroups-removing-members).

Next, connect to each member cluster and check it, in [Connect and check your member clusters](databaseclustergroups-gs-connect.md). If you don't use routing, you can then continue at [Managing a database cluster group for Aurora](databaseclustergroups-managing.md).