To clone a MySQL RDS snapshot using the AWS CLI, you can use the aws rds restore-db-instance-from-db-snapshot
command. This command restores a new DB instance from a DB snapshot.
Here is an example of how you might use this command to clone a MySQL RDS snapshot to a new DB instance:
aws rds restore-db-instance-from-db-snapshot \
--db-snapshot-identifier my-source-snapshot-id \
--db-instance-identifier my-new-db-instance-id \
--db-instance-class db.t2.micro \
--engine mysql \
--publicly-accessible
This command restores a new DB instance from the snapshot identified by my-source-snapshot-id
, and assigns it the ID my-new-db-instance-id
. The new DB instance will have the class db.t2.micro
and use the MySQL engine. It will also be publicly accessible.
You can find more information about the restore-db-instance-from-db-snapshot
command and the other available RDS commands in the doc
https://docs.aws.amazon.com/cli/latest/reference/rds/index.html