Aurora data groups reference
This reference lists the AWS CLI commands, SQL statements, status values, events, and errors for data groups. The topic for each data group task also includes the commands for that task.
Topics
AWS CLI commands and Amazon RDS API operations for data groups
The following table lists the AWS CLI commands and API operations for data groups.
| AWS CLI command | API operation | What it does |
|---|---|---|
|
|
|
Creates an empty data group. Takes |
|
|
|
Describes one data group ( |
|
|
|
Turns on, renames, or turns off the data group endpoint. For more information, see Data group endpoints. |
|
|
|
Runs one move step. |
|
|
|
Deletes a data group. |
|
|
|
Lists the times to which you can restore a data group. |
|
|
|
Lists the data groups in a snapshot, or the snapshots that hold a data group. |
Existing commands also have data group options and fields:
-
restore-db-cluster-from-snapshotandrestore-db-cluster-to-point-in-time–--data-group-restore-configurationschooses the data groups to restore. -
describe-db-engine-versions–SupportsDataGroupsshows whether a version supports data groups. -
describe-db-cluster-snapshotsanddescribe-db-cluster-automated-backups–CustomDataGroupPresentshows whether the backup holds data groups that you created. -
describe-events–--source-type data-grouplists data group events.
Data group operations return a DataGroup object with the following fields: DBClusterIdentifier,
TargetDBClusterIdentifier, DataGroupName, DataGroupIdentifier, DataGroupArn,
KMSKeyId, AdditionalEncryptionContext, StorageEncryptionType, Status,
Endpoint, ReaderEndpoint, HostedZoneId, Tags, and
CreateTime. The response doesn't include fields that have no value. For example, it doesn't include
KMSKeyId when the data group uses an AWS owned key, and it doesn't include the endpoint fields when the data
group doesn't have a data group endpoint.
SQL for data groups
The following list shows the SQL for each data group task. Run these statements on the writer DB instance.
- What a data group holds
-
Databases. A data group shows as a tablespace with the same name.
- Create a database in a data group
-
CREATE DATABASEdbTABLESPACEdg;Or set the data group for the session first:
SET aurora_datagroup = 'dg'; CREATE DATABASEdb; RESET aurora_datagroup; - List data groups
-
SELECT * FROM pg_catalog.aurora_datagroups; - See which data group a database is in
-
Join
pg_databaseandpg_tablespaceondattablespace. - Map a role
-
SELECT * FROM aurora_datagroup_add_role_access('dg', 'type', 'role'); - List mappings
-
SELECT * FROM aurora_datagroup_list_role_access(); - Remove a mapping
-
SELECT * FROM aurora_datagroup_remove_role_access('dg', 'role'); - Find principals that block a move
-
Prepare reports them in its error.
- Start, switch over, or cancel a data group migration
-
SELECT aurora_start_data_group_migration('database', 'dg'); SELECT aurora_switchover_data_group_migration('database'); SELECT aurora_cancel_data_group_migration('database'); - Monitor a data group migration
-
SELECT * FROM information_schema.aurora_data_group_migration_status;
Data group status values reference
The following table lists the data group status values in the Amazon RDS API and the console, and the operations that each one allows.
| API value | Console label | Operations you can start |
|---|---|---|
|
Creating |
None |
|
Create failed |
Delete |
|
Active |
Prepare a move, change the data group endpoint, delete (if empty) |
|
Modifying |
None |
|
Preparing for move |
Cancel the move |
|
Ready to move |
Execute the move, cancel the move |
|
Move in progress |
None |
|
Cancelling move |
None |
|
Restoring |
None |
|
Inaccessible encryption credentials |
Delete |
|
Deleting |
None |
For what each status means, see Data group status values.
Most status changes finish within minutes. If a data group stays in creating, preparing-for-move, or
cancelling-move for more than an hour, and the data group events show no reason, contact AWS Support. You
can't delete a data group in creating, and you can't cancel a cancelling-move. If a data group stays in
preparing-for-move, check for the conditions in Before you move a data group,
such as an open prepared transaction. Then cancel the move with cancel-move.
Data group events
The following table lists the Amazon RDS events for data groups. The source type is data-group. Messages that name a
DB cluster use its identifier.
| Event ID | Category | Message |
|---|---|---|
RDS-EVENT-0515 |
creation |
Data group created |
RDS-EVENT-0530 |
failure |
Data group failed to create due to: |
RDS-EVENT-0531 |
notification |
Started data group prepare-move from |
RDS-EVENT-0532 |
notification |
Data group ready for move (prepare complete) |
RDS-EVENT-0533 |
notification |
Data group move complete - execute done |
RDS-EVENT-0534 |
failure |
The message gives the reason the move failed. For example, a database with the same name already exists on the target DB cluster, or Amazon RDS can't access the data group's KMS key. |
RDS-EVENT-0535 |
notification |
Data group prepare-move from |
RDS-EVENT-0536 |
deletion |
Data group deleted |
RDS-EVENT-0537 |
failure |
Data group not empty and cannot be deleted |
RDS-EVENT-0538 |
failure |
Amazon RDS is unable to access the KMS encryption key for data group |
Data group errors
The following table lists the errors that data group operations can return, with their common causes and the actions to resolve them.
| Error | Cause | Action |
|---|---|---|
|
The name is already in use. |
Choose another name, rename the conflicting database, or move to a DB cluster where the name is free. |
|
The DB cluster has reached its data group quota, 100 data groups at preview. For a move, this applies to the target DB cluster. |
Delete data groups that you don't need, or use another DB cluster. |
|
The identifier is wrong, or the data group was deleted. |
Use the |
|
A value has the wrong format. For example, a data group name, or the |
Read the error message. For a data group, use the |
|
The status doesn't allow the operation, or another operation is running on the data group. For example,
you ran |
Check the status, then run an operation that the status allows. For the allowed operations, see Data group status values reference. |
|
The source or target DB cluster isn't available, or doesn't meet a data group requirement such as Aurora I/O-Optimized storage or a writer DB instance. |
Read the error message. Wait until the DB cluster is available, or fix the requirement that it names. |
|
The DB cluster identifier is wrong. |
Check the identifier and the AWS Region. |
|
The KMS key doesn't exist, isn't enabled, or you don't have permission to use it. |
Fix the key policy or grants, or enable the key. |
|
No restore window matches the request. |
Check the data group identifier, or the backup ARN and time. |
|
The snapshot doesn't hold the data group. |
Check the snapshot and data group identifiers. |
When a move fails, the error message describes the problem. Common causes include the following:
-
A name that's already in use on the target DB cluster.
-
A parameter value that differs between the source and target DB clusters. For example, a parameter mismatch returns a message such as
Cannot move data group: parameter 'time_zone' must have the same value on source and target clusters. -
A target DB cluster that doesn't use Aurora I/O-Optimized storage.