Add an Amazon Web Services Region to a keyspace in Amazon Keyspaces - Amazon Keyspaces (for Apache Cassandra)
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).

Add an Amazon Web Services Region to a keyspace in Amazon Keyspaces

You can add a new Amazon Web Services Region to a keyspace that is either a single or a multi-Region keyspace. The new replica Region is applied to all tables in the keyspace.

To change a single-Region to a multi-Region keyspace, you have to enable client-side timestamps for all tables in the keyspace. For more information, see Client-side timestamps in Amazon Keyspaces.

If you're adding an additional Region to a multi-Region keyspace, Amazon Keyspaces has to replicate the existing table(s) into the new Region using a one-time cross-Region restore for each existing table. The restore charges for each table are billed per GB, for more information see Backup and restore on the Amazon Keyspaces (for Apache Cassandra) pricing page. There's no charge for data transfer across Regions for this restore operation. In addition to data, all table properties with the exception of tags are going to be replicated to the new Region.

You can use the ALTER KEYSPACE statement in CQL, the update-keyspace command with the Amazon CLI, or the console to add a new Region to a single or to a multi-Region keyspace in Amazon Keyspaces. In order to run the statement successfully, the account you're using has to be located in one of the Regions where the keyspace is already available. While the replica is being added, you can't perform any other data definition language (DDL) operations on the resources that are being updated and replicated.

For more information about the permissions required to add a Region, see Configure the IAM permissions required to add an Amazon Web Services Region to a keyspace.

Note

When adding an additional Region to a single-Region keyspace, Amazon Keyspaces creates a service-linked role with the name AWSServiceRoleForAmazonKeyspacesReplication in your account. This role allows Amazon Keyspaces to replicate tables to new Regions and to replicate writes from one table to all replicas of a multi-Region table on your behalf. To learn more, see Using roles for Amazon Keyspaces Multi-Region Replication.

Console

Follow these steps to add a Region to a keyspace using the Amazon Keyspaces console.

Add a Region to a keyspace (console)
  1. Sign in to the Amazon Web Services Management Console, and open the Amazon Keyspaces console at https://console.amazonaws.cn/keyspaces/home.

  2. In the navigation pane, choose Keyspaces, and then choose a keyspace from the list.

  3. Choose the Amazon Web Services Regions tab.

  4. On the Amazon Web Services Regions tab, choose Add Region.

  5. In the Add Region dialog, choose the additional Region that you want to add to the keyspace.

  6. To finish, choose Add.

Cassandra Query Language (CQL)
Add a Region to a keyspace using CQL
  • To add a new Region to a keyspace, you can use the following statement. In this example, the keyspace is already available in the US East (N. Virginia) Region and US West (Oregon) Region Regions, and the CQL statement is adding the Region US West (N. California) Region.

    ALTER KEYSPACE my_keyspace WITH REPLICATION = { 'class': 'NetworkTopologyStrategy', 'us-east-1': '3', 'us-west-2': '3', 'us-west-1': '3' } AND CLIENT_SIDE_TIMESTAMPS = {'status': 'ENABLED'};
CLI
Add a Region to a keyspace using the Amazon CLI
  • To add a new Region to a keyspace using the CLI, you can use the following example. Note that the default value for client-side-timestamps is DISABLED. With the update-keyspace command, you must change the value to ENABLED.

    aws keyspaces update-keyspace \ --keyspace-name my_keyspace \ --replication-specification '{"replicationStrategy": "MULTI_REGION", "regionList": ["us-east-1", "eu-west-1", "eu-west-3"] }' \ --client-side-timestamps '{"status": "ENABLED"}'