Skip to content

Commit

Permalink
Explain how to create AWS RDS snapshots via the AWS CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanb-gds committed Jan 31, 2025
1 parent 1f2d58e commit baa9c1a
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions source/manual/howto-backup-and-restore-in-aws-rds.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This playbook describes how to restore a database instance using Amazon's [RDS B

We use RDS Backups to give us fully nightly backups and point-in-time recovery (PITR) (also known as continuous data protection or CDP).

> We only run RDS Backup in the production environment. To run a test restore in staging or integration, you must first take a manual snapshot from the AWS console.
> We only run RDS Backup in the production environment. To run a test restore in staging or integration, you must first take a manual snapshot from the AWS console or via the AWS CLI.
>
> Make sure the snapshot's name contains the name of the app (e.g. `local-links-manager`), and remember to delete it afterwards.
Expand Down Expand Up @@ -45,7 +45,25 @@ snapshot_arn="<e.g. arn:aws:rds:eu-west-1:210287912431:snapshot:rds:local-links-

If no snapshots are available on Integration for the drill you can manually take a snapshot. You can do this in the [RDS Snapshots](https://eu-west-1.console.aws.amazon.com/rds/home?region=eu-west-1#take-snapshots:) section of the AWS Console. Simply pick the DB instance you want in the `DB instance` select and give it a `Snapshot name`.

After this run the command above and you should now see an ARN of your backup.
Alternatively, you can take a snapshot via the AWS CLI:

```sh
gds-cli aws govuk-${environment?}-admin \
aws rds create-db-snapshot \
--db-instance-identifier ${db-instance-name} \
--db-snapshot-identifier ${your-snapshot-name}
```

You can check the snapshot progress by running:

```sh
gds-cli aws govuk-${environment?}-admin \
aws rds describe-db-snapshots \
--db-snapshot-identifier ${your-snapshot-name} \
--query 'DBSnapshots[DBSnapshotArn,Status,PercentProgress]'
```

Once the snapshot has been created, copy the ARN.

### 2. Find which database the snapshot was generated by

Expand Down

0 comments on commit baa9c1a

Please sign in to comment.