{Neptune}Neptune でのデータベースのクローン化

-- 1. DBクラスター作成

aws neptune create-db-cluster \
--db-cluster-identifier cluster01 \
--engine neptune \
--engine-version 1.0.5.0 \
--port 8182 \
--no-storage-encrypted \
--no-deletion-protection

aws neptune create-db-instance \
--db-cluster-identifier cluster01 \
--engine neptune \
--db-instance-identifier instance01 \
--db-instance-class db.t3.medium \
--no-multi-az \
--no-auto-minor-version-upgrade

aws neptune describe-db-clusters --db-cluster-identifier cluster01
aws neptune describe-db-instances --db-instance-identifier instance01


-- 2. DBクラスターのクローン作成

aws neptune restore-db-cluster-to-point-in-time \
--source-db-cluster-identifier cluster01 \
--db-cluster-identifier cluster01-clone \
--restore-type copy-on-write \
--use-latest-restorable-time

aws neptune create-db-instance \
--db-cluster-identifier cluster01-clone \
--engine neptune \
--db-instance-identifier instance01-clone \
--db-instance-class db.t3.medium \
--no-multi-az \
--no-auto-minor-version-upgrade

aws neptune describe-db-clusters --db-cluster-identifier cluster01-clone
aws neptune describe-db-instances --db-instance-identifier instance01-clone

 

-- 3. クリーンアップ

-- インスタンスの削除
aws neptune delete-db-instance \
--db-instance-identifier instance01 \
--skip-final-snapshot

aws neptune delete-db-instance \
--db-instance-identifier instance01-clone \
--skip-final-snapshot


aws neptune describe-db-instances

-- クラスターの削除
aws neptune delete-db-cluster \
--db-cluster-identifier cluster01 \
--skip-final-snapshot

aws neptune delete-db-cluster \
--db-cluster-identifier cluster01-clone \
--skip-final-snapshot

aws neptune describe-db-clusters