2017-11-13 41 views
0

空のデータベースのデータベース作成文字列を既存のデータベースの設定で自動的に生成する方法はありますか?既存のデータベースからRDSインスタンスを作成するaws cliコマンドを取得

ブラウザでコンソールを使用してAWS RDS postgresqlデータベースインスタンスを作成しました。私はブラウザですべての種類の設定を選択し、インスタンスを起動しました。今私はプログラムで使用するためのコマンドでこのデータベース(空)を複製したいと思います。

aws create-db-instance --db-name database02 --allocated-storage 200 --engine postgres etc. 

答えて

1

ソース・データベース、インスタンスまたはクラスタのスナップショットを作成する必要があります:私のような既存のRDSので、生のコマンドが好ましいであろうインスタンス(別のRDSへの参照)が、何かを削除したいですそのスナップショットに基づいて新しいデータベースを作成します。スナップショットの完了後、ソースデータベースを削除できます。

aws rds create-db-snapshot 
    --db-snapshot-identifier mydbsnapshot 
    --db-instance-identifier mydb 

aws rds restore-db-instance-from-db-snapshot 
    --db-instance-identifier mynewdbinstance 
    --db-snapshot-identifier mydbsnapshot 

http://docs.aws.amazon.com/cli/latest/reference/rds/create-db-snapshot.html

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_RestoreFromSnapshot.html

http://docs.aws.amazon.com/cli/latest/reference/rds/restore-db-instance-from-db-snapshot.html

関連する問題