A company wants to share a daily Amazon RDS PostgreSQL database snapshot from its production AWS account (Account A) to a data analytics AWS account (Account B). The production database is encrypted at rest using an AWS KMS key. The solution must ensure that the snapshot is securely shared, decrypted, and restored in Account B while adhering to the principle of least privilege.
Which set of actions will meet these requirements?
- AEnsure the RDS database is encrypted with the default AWS managed key (aws/rds) in Account A. Modify the KMS key policy in Account A to allow Account B access. Share the DB snapshot with Account B, and then restore the DB instance directly in Account B from the shared snapshot.
- BEnsure the RDS database is encrypted with a customer managed KMS key in Account A. Store the KMS key ARN in an AWS Systems Manager Parameter Store parameter of type String. Share the DB snapshot with Account B. In Account B, restore the DB instance directly from the shared snapshot by reading the KMS key ARN from the Parameter Store.
- Ensure the RDS database is encrypted with a customer managed KMS key in Account A. Modify the key policy of the customer managed key in Account A to grant Account B access. Share the DB snapshot with Account B. In Account B, copy the shared DB snapshot to a new DB snapshot encrypted with a KMS key in Account B, and then restore the DB instance from the copied snapshot.Cevap
- DEnsure the RDS database is encrypted with a customer managed KMS key in Account A. Share the DB snapshot with Account B. In Account B, use the AWS account root user credentials to copy the shared DB snapshot, encrypt it with Account B's KMS key, and restore the DB instance to bypass the KMS key policy requirements in Account A.
Cevap
Ensure the RDS database is encrypted with a customer managed KMS key in Account A. Modify the key policy of the customer managed key in Account A to grant Account B access. Share the DB snapshot with Account B. In Account B, copy the shared DB snapshot to a new DB snapshot encrypted with a KMS key in Account B, and then restore the DB instance from the copied snapshot.
The correct solution uses a customer managed key (CMK) in the source account, grants the target account access to that CMK via its key policy, shares the RDS snapshot, and then copies the snapshot locally in the target account using the target account's KMS key before restoring. This complies with AWS restrictions where AWS managed keys cannot be shared, and encrypted RDS snapshots cannot be directly restored across accounts.
Adım Adım Çözüm
Anahtar Kavram
Cross-Account KMS Key Sharing and RDS Snapshot Restore Mechanics
Alternatif Yöntem
Instead of sharing and copying the snapshot directly, an alternative is to export the RDS snapshot data to an Amazon S3 bucket in Account A encrypted with a customer managed KMS key, grant Account B access to the S3 bucket and key, and then import the data into a new RDS DB instance in Account B. However, this is operationally more complex.
Tahmini Süre:2m 30s