-
Notifications
You must be signed in to change notification settings - Fork 1
Disaster Recovery
You need to rollback to the version you would like to go back to.
- Verify on the AWS console that a backup version exists
- Connect to the service pod
$ kubectl exec -n $namespace --stdin --tty $pod_name -- /bin/sh
- Once connected, run
aws s3api list-object-versions --bucket bucketname --prefix path/to/file
. This will list all versions of the file in chronological order by LastModified date. - The next step is to delete all previous versions until you get to the one you would like to roll back to.
- To delete a version run
aws s3api delete-object --bucket bucketname --key path/to/file --version-id versionId
Snapshots are currently taken daily and can also be manually taken whenever necessary
-
Get the
db-instance-identifier
of the DB instance you want to restore, using the Cloud Platform CLI;cloud-platform decode-secret -n hale-platform-env -s rds-instance-output
-
Look for a line containing ‘rds_instance_address’ E.g
cloud-platform-gffgfg.hthf.eu-west-2.rds.amazonaws.com
-
Search for snapshots of the db using ...
-
Locate the
DBSnapshotIdentifier
of the snapshot you would like to restore to. E.grds:cloud-platform-gffgfg.hthf-2024-03-20-06-18
-
Update the rds.tf in cloud-platform-environments and the hale environment you would like to restore to.
-
Add the line
snapshot_identifier = "rds:cloud-platform-gffgfg.hthf-2024-03-20-06-18"
-
Your RDS
db_allocated_storage
will be autoscaled to maximum of 10000 by default unless you have set to specific number. Hence, the actual db_allocated_storage may be higher than what is set as default(10). -
Check the actual “AllocatedStorage” value described in your RDS instance using the command
aws rds describe-db-instances --db-instance-identifier <your-rds-db-identifier>
This was located in step 4. -
If that is different to what is set for your RDS, update your RDS manifest to include the actual db_allocated_storage by adding
db_allocated_storage = "<the actual value you got from the above cli command>"