LoginSignup
5
3

More than 5 years have passed since last update.

Aurora を AWS CLI でスナップショットから復元する

Last updated at Posted at 2018-02-23

Aurora をスナップショットから CLI で復元します。

参考

流れ

  1. Aurora クラスターの復元
  2. クラスターへのインスタンスの追加

(参考)
aurora のスナップショットはどうやらクラスターのスナップショットとして保存されるようで、restore-db-instance-from-db-snapshot では復元できませんでした。

$ aws rds restore-db-instance-from-db-snapshot --cli-input-json file://restore-db-instance-from-db-snapshot.json

An error occurred (DBSnapshotNotFound) when calling the RestoreDBInstanceFromDBSnapshot operation: DBSnapshot not found: test-aurora

1. restore-db-cluster-from-snapshot

$ cat restore-db-cluster-from-snapshot.json
{
    "AvailabilityZones": [
        "ap-northeast-1a", "ap-northeast-1c", "ap-northeast-1d"
    ],
    "DBClusterIdentifier": "test-aurora-cluster",
    "SnapshotIdentifier": "test-aurora",
    "Engine": "aurora-mysql"
}


$aws rds restore-db-cluster-from-snapshot --cli-input-json file://restore-db-cluster-from-snapshot.json

2. create-db-instance

$ cat create-db-instance.json
{
    "DBInstanceIdentifier": "test-aurora",
    "DBInstanceClass": "db.t2.small",
    "Engine": "aurora-mysql",
    "PubliclyAccessible": false,
    "DBClusterIdentifier": "test-aurora-cluster",
    "CopyTagsToSnapshot": true
}

$ aws rds create-db-instance --cli-input-json file://create-db-instance.json
5
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
3