本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
跨帳戶複製資料庫叢集快照
您可以使用 Amazon RDS API ModifyDBClusterSnapshotAttribute 和 CopyDBClusterSnapshot 動作,讓其他 AWS 帳戶可以複製您指定的資料庫叢集快照。您只能在相同 AWS 區域 中跨帳戶複製資料庫叢集快照。跨帳戶複製程序如下所示,其中帳戶 A 提供可複製的快照,而帳戶 B 會複製快照。
-
使用帳戶 A,呼叫
ModifyDBClusterSnapshotAttribute,並在restore參數中指定AttributeName,在ValuesToAdd參數中指定帳戶 B 的 ID。 -
(如果快照已加密) 使用帳戶 A,更新 KMS 金鑰的金鑰政策,先將帳戶 B 的 ARN 新增為
Principal,然後允許kms:CreateGrant動作。 -
(如果快照已加密) 使用帳戶 B,選擇或建立使用者,並將 IAM 政策連接到該使用者,以允許使用者以您的 KMS 金鑰來複製已加密的資料庫叢集快照。
-
使用帳戶 B,呼叫
CopyDBClusterSnapshot,並使用SourceDBClusterSnapshotIdentifier參數來指定要複製之資料庫叢集快照的 ARN,其中必須包含帳戶 A 的 ID。
若要列出所有允許還原資料庫叢集快照的 AWS 帳戶,請使用 DescribeDBSnapshotAttributes 或 DescribeDBClusterSnapshotAttributes API 操作。
若要移除 AWS 帳戶的共用許可,請使用 ModifyDBSnapshotAttribute 或 ModifyDBClusterSnapshotAttribute 動作,並將 AttributeName 設為 restore,在 ValuesToRemove 參數中指定要移除之帳戶的 ID。
使用下列程序,將未加密的資料庫叢集快照複製至相同 AWS 區域 中的另一個帳戶。
在資料庫叢集快照的來源帳戶中,呼叫
ModifyDBClusterSnapshotAttribute,並在restore參數中指定AttributeName,在ValuesToAdd參數中指定目標帳戶的 ID。使用帳戶
987654321執行下列範例,以允許兩個 AWS 帳戶識別符 (123451234512和123456789012) 還原名為manual-snapshot1的資料庫叢集快照。https://rds.us-west-2.amazonaws.com/ ?Action=ModifyDBClusterSnapshotAttribute &AttributeName=restore &DBClusterSnapshotIdentifier=manual-snapshot1 &SignatureMethod=HmacSHA256&SignatureVersion=4 &ValuesToAdd.member.1=123451234512 &ValuesToAdd.member.2=123456789012 &Version=2014-10-31 &X-Amz-Algorithm=AWS4-HMAC-SHA256 &X-Amz-Credential=AKIADQKE4SARGYLE/20150922/us-west-2/rds/aws4_request &X-Amz-Date=20150922T220515Z &X-Amz-SignedHeaders=content-type;host;user-agent;x-amz-content-sha256;x-amz-date &X-Amz-Signature=ef38f1ce3dab4e1dbf113d8d2a265c67d17ece1999ffd36be85714ed36dddbb3-
在目標帳戶中,呼叫
CopyDBClusterSnapshot,並使用SourceDBClusterSnapshotIdentifier參數來指定要複製之資料庫叢集快照的 ARN,其中必須包含來源帳戶的 ID。使用帳戶
123451234512執行下列範例,以便從帳戶aurora-cluster1-snapshot-20130805複製資料庫叢集快照987654321,並建立名為dbclustersnapshot1的資料庫叢集快照。https://rds.us-west-2.amazonaws.com/ ?Action=CopyDBClusterSnapshot &CopyTags=true &SignatureMethod=HmacSHA256 &SignatureVersion=4 &SourceDBClusterSnapshotIdentifier=arn:aws:rds:us-west-2:987654321:cluster-snapshot:aurora-cluster1-snapshot-20130805 &TargetDBClusterSnapshotIdentifier=dbclustersnapshot1 &Version=2013-09-09 &X-Amz-Algorithm=AWS4-HMAC-SHA256 &X-Amz-Credential=AKIADQKE4SARGYLE/20150922/us-west-2/rds/aws4_request &X-Amz-Date=20140429T175351Z &X-Amz-SignedHeaders=content-type;host;user-agent;x-amz-content-sha256;x-amz-date &X-Amz-Signature=9164337efa99caf850e874a1cb7ef62f3cea29d0b448b9e0e7c53b288ddffed2
使用下列程序,將已加密的資料庫叢集快照複製至相同 AWS 區域 中的另一個帳戶。
-
在資料庫叢集快照的來源帳戶中,呼叫
ModifyDBClusterSnapshotAttribute,並在restore參數中指定AttributeName,在ValuesToAdd參數中指定目標帳戶的 ID。使用帳戶
987654321執行下列範例,以允許兩個 AWS 帳戶識別符 (123451234512和123456789012) 還原名為manual-snapshot1的資料庫叢集快照。https://rds.us-west-2.amazonaws.com/ ?Action=ModifyDBClusterSnapshotAttribute &AttributeName=restore &DBClusterSnapshotIdentifier=manual-snapshot1 &SignatureMethod=HmacSHA256&SignatureVersion=4 &ValuesToAdd.member.1=123451234512 &ValuesToAdd.member.2=123456789012 &Version=2014-10-31 &X-Amz-Algorithm=AWS4-HMAC-SHA256 &X-Amz-Credential=AKIADQKE4SARGYLE/20150922/us-west-2/rds/aws4_request &X-Amz-Date=20150922T220515Z &X-Amz-SignedHeaders=content-type;host;user-agent;x-amz-content-sha256;x-amz-date &X-Amz-Signature=ef38f1ce3dab4e1dbf113d8d2a265c67d17ece1999ffd36be85714ed36dddbb3 -
在資料庫叢集快照的來源帳戶中,在與加密資料庫叢集快照相同的 AWS 區域 中建立自訂 KMS 金鑰。建立客戶自管金鑰時,您可以提供目標 AWS 帳戶 的存取權。如需更多詳細資訊,請參閱 建立客戶自管金鑰並授予存取權。
-
將快照複製到目標 AWS 帳戶 並共用。如需更多詳細資訊,請參閱 從來源帳戶複製和共用快照。
-
在目標帳戶中,呼叫
CopyDBClusterSnapshot,並使用SourceDBClusterSnapshotIdentifier參數來指定要複製之資料庫叢集快照的 ARN,其中必須包含來源帳戶的 ID。使用帳戶
123451234512執行下列範例,以便從帳戶aurora-cluster1-snapshot-20130805複製資料庫叢集快照987654321,並建立名為dbclustersnapshot1的資料庫叢集快照。https://rds.us-west-2.amazonaws.com/ ?Action=CopyDBClusterSnapshot &CopyTags=true &SignatureMethod=HmacSHA256 &SignatureVersion=4 &SourceDBClusterSnapshotIdentifier=arn:aws:rds:us-west-2:987654321:cluster-snapshot:aurora-cluster1-snapshot-20130805 &TargetDBClusterSnapshotIdentifier=dbclustersnapshot1 &Version=2013-09-09 &X-Amz-Algorithm=AWS4-HMAC-SHA256 &X-Amz-Credential=AKIADQKE4SARGYLE/20150922/us-west-2/rds/aws4_request &X-Amz-Date=20140429T175351Z &X-Amz-SignedHeaders=content-type;host;user-agent;x-amz-content-sha256;x-amz-date &X-Amz-Signature=9164337efa99caf850e874a1cb7ef62f3cea29d0b448b9e0e7c53b288ddffed2