01 Run restore-db-cluster-to-point-in-time command (OSX/Linux/UNIX) to re-create your Aurora MySQL database cluster and enable backtracking for the new database cluster. The following command request example creates a clone named cc-new-aurora-mysql-cluster from a source Aurora database cluster called cc-aurora-mysql-cluster that has the Backtrack window set to 24 hours (86400 seconds). When configured, the target Backtrack window must be set to a number from 0 to 259,200 (72 hours):
aws rds restore-db-cluster-to-point-in-time
--region us-east-1
--source-db-cluster-identifier cc-aurora-mysql-cluster
--db-cluster-identifier cc-new-aurora-mysql-cluster
--restore-type copy-on-write
--use-latest-restorable-time
--backtrack-window 86400
02 The command output should return the configuration metadata for the clone database cluster:
{
"DBCluster": {
"MasterUsername": "ccadmin",
"ReaderEndpoint": "cc-new-aurora-mysql-cluster.cluster-ro-abcdabcdabcd.us-east-1.rds.amazonaws.com",
"HttpEndpointEnabled": false,
"ReadReplicaIdentifiers": [],
"VpcSecurityGroups": [
{
"Status": "active",
"VpcSecurityGroupId": "sg-0abcd1234abcd1234"
},
{
"Status": "active",
"VpcSecurityGroupId": "sg-abcd1234"
}
],
"CopyTagsToSnapshot": true,
"HostedZoneId": "ABCDABCDABCDAB",
"EngineMode": "provisioned",
"Status": "available",
"MultiAZ": false,
"LatestRestorableTime": "2021-05-12T09:00:00.162Z",
"DomainMemberships": [],
"PreferredBackupWindow": "04:06-04:36",
"DBSubnetGroup": "default-vpc-abcdabcd",
"AllocatedStorage": 50,
"BackupRetentionPeriod": 7,
"PreferredMaintenanceWindow": "tue:05:48-tue:06:18",
"Engine": "aurora-mysql",
"Endpoint": "cc-new-aurora-mysql-cluster.cluster-abcdabcdabcd.us-east-1.rds.amazonaws.com",
"AssociatedRoles": [],
"EarliestRestorableTime": "2021-05-12T09:03:00.657Z",
"CrossAccountClone": false,
"IAMDatabaseAuthenticationEnabled": true,
"ClusterCreateTime": "2021-05-12T09:00:00.853Z",
"EngineVersion": "5.7.mysql_aurora.2.07.2",
"DeletionProtection": true,
"DBClusterIdentifier": "cc-new-aurora-mysql-cluster",
"DbClusterResourceId": "cluster-ABCDABCDABCDABCDABCDABCDAB",
"DBClusterMembers": [
{
"IsClusterWriter": true,
"DBClusterParameterGroupStatus": "in-sync",
"PromotionTier": 1,
"DBInstanceIdentifier": "cc-new-aurora-mysql-cluster-instance-1"
}
],
"DBClusterArn": "arn:aws:rds:us-east-1:123456789012:cluster:cc-new-aurora-mysql-cluster",
"StorageEncrypted": false,
"DatabaseName": "",
"DBClusterParameterGroup": "default.aurora-mysql5.7",
"AvailabilityZones": [
"us-east-1c",
"us-east-1d",
"us-east-1a"
],
"Port": 3306
}
}
03 Once the new database cluster is created, replace the required endpoints within your application code to switch the source cluster with the new cluster.
04 (Optional) You can remove the source Aurora database cluster in order to avoid further charges:
- Run delete-db-instance command (OSX/Linux/UNIX) to remove the primary database instance from the Aurora cluster that you want to terminate:
aws rds delete-db-instance
--region us-east-1
--db-instance-identifier cc-aurora-mysql-cluster-instance-1
--skip-final-snapshot
--query 'DBInstance.DBInstanceStatus'
- The command output should return the current status for the selected database instance:
- Execute delete-db-cluster command (OSX/Linux/UNIX) to delete the source Aurora MySQL database cluster:
aws rds delete-db-cluster
--region us-east-1
--db-cluster-identifier cc-aurora-mysql-cluster
--skip-final-snapshot
- The command output should return the metadata available for the terminated cluster:
{
"DBCluster": {
"MasterUsername": "ccadmin",
"ReaderEndpoint": "cc-aurora-mysql-cluster.cluster-ro-abcdabcdabcd.us-east-1.rds.amazonaws.com",
"HttpEndpointEnabled": false,
"ReadReplicaIdentifiers": [],
"VpcSecurityGroups": [
{
"Status": "active",
"VpcSecurityGroupId": "sg-0abcd1234abcd1234"
},
{
"Status": "active",
"VpcSecurityGroupId": "sg-abcd1234"
}
],
"CopyTagsToSnapshot": true,
"HostedZoneId": "ABCDABCDABCDAB",
"EngineMode": "provisioned",
"Status": "available",
"MultiAZ": false,
"LatestRestorableTime": "2021-05-12T09:00:00.162Z",
"DomainMemberships": [],
"PreferredBackupWindow": "04:06-04:36",
"DBSubnetGroup": "default-vpc-abcdabcd",
"AllocatedStorage": 50,
"BackupRetentionPeriod": 7,
"PreferredMaintenanceWindow": "tue:05:48-tue:06:18",
"Engine": "aurora-mysql",
"Endpoint": "cc-aurora-mysql-cluster.cluster-abcdabcdabcd.us-east-1.rds.amazonaws.com",
"AssociatedRoles": [],
"EarliestRestorableTime": "2021-05-12T09:03:00.657Z",
"CrossAccountClone": false,
"IAMDatabaseAuthenticationEnabled": true,
"ClusterCreateTime": "2021-05-12T09:00:00.853Z",
"EngineVersion": "5.7.mysql_aurora.2.07.2",
"DeletionProtection": true,
"DBClusterIdentifier": "cc-aurora-mysql-cluster",
"DbClusterResourceId": "cluster-ABCDABCDABCDABCDABCDABCDAB",
"DBClusterMembers": [
{
"IsClusterWriter": true,
"DBClusterParameterGroupStatus": "in-sync",
"PromotionTier": 1,
"DBInstanceIdentifier": "cc-aurora-mysql-cluster-instance-1"
}
],
"DBClusterArn": "arn:aws:rds:us-east-1:123456789012:cluster:cc-aurora-mysql-cluster",
"StorageEncrypted": false,
"DatabaseName": "",
"DBClusterParameterGroup": "default.aurora-mysql5.7",
"AvailabilityZones": [
"us-east-1c",
"us-east-1d",
"us-east-1a"
],
"Port": 3306
}
}
05 Repeat steps no. 1 – 4 for each Aurora database cluster available in the selected AWS region.
06 Change the AWS cloud region by updating the --region command parameter value and repeat the Remediation process for other regions.