Aurora PostgreSQL restore from Snapshot with CLI

0

Hi,

I am interested in using CLI's for our Aurora PostgreSQL. When using through Interface if I restore a snapshot it creates cluster & DB instance.I understand when using CLI's first I need to create cluster using RestoreDBClusterToPointInTime.How can I create instance with same settings from the snapshot using "CreateDBInstance".

I simply want to replicate all GUI steps of restoring from snapshot including the instance through CLI

vk8536
已提問 3 個月前檢視次數 175 次
1 個回答
1

Hello.

The command is described in the documentation here.
The command below is an example for Aurora MySQL, but I think it can be executed using similar steps for Aurora PostgreSQL.
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.Managing.Clone.html#Aurora.Managing.Clone.create

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

aws rds describe-db-clusters \
  --db-cluster-identifier tpch100g-clone \
    --query '*[].[Engine]' \
    --output text


aws rds create-db-instance \
  --db-instance-identifier tpch100g-clone-instance \
  --db-cluster-identifier tpch100g-clone \
  --db-instance-class db.r5.4xlarge \
  --engine aurora-mysql

profile picture
專家
已回答 3 個月前
profile picture
專家
已審閱 3 個月前
  • aws rds create-db-instance
    --db-instance-identifier tpch100g-clone-instance
    --db-cluster-identifier tpch100g-clone
    --db-instance-class db.r5.4xlarge
    --engine aurora-mysql

    Will create all my databases, logins & namespace matching to source cluster?

  • Yes, I think it will be restored with the same data as the original Aurora.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南