A SysOps Administrator is configuring cross-account, cross-region replication for an Amazon S3 bucket. The source bucket is in Account A (us-east-1) and contains objects encrypted with an AWS KMS customer managed key. The destination bucket is in Account B (us-west-2). The administrator has enabled versioning on the source bucket, created the replication configuration in Account A, and specified a new replication IAM role in Account A. However, the replication is failing, and no objects are appearing in the destination bucket. Which two actions must the administrator take to successfully replicate the KMS-encrypted objects?
- Enable bucket versioning on the destination bucket in Account B.Answer
- Modify the KMS key policy in Account B to grant the replication IAM role from Account A permissions to perform kms:GenerateDataKey and kms:Encrypt actions.Answer
- CModify the replication IAM role in Account A to include iam:PassRole permissions targeting the S3 replication service principal.
- DAssociate the destination bucket's subnet route table in Account B with an S3 Gateway Endpoint to authorize cross-account replication traffic.
- EConfigure the replication rule to use the default AWSServiceRoleForS3Replication service-linked role to automatically inherit permissions for cross-account KMS key access.
Answer
Enable bucket versioning on the destination bucket in Account B, and modify the KMS key policy in Account B to grant the replication IAM role from Account A permissions to perform kms:GenerateDataKey and kms:Encrypt actions.
Replicating KMS-encrypted objects across accounts requires S3 versioning to be enabled on both the source and destination buckets, as S3 replication requires versioning to track and sync objects. Additionally, the replication IAM role in Account A must have permissions to encrypt objects in the destination bucket using Account B's KMS key. This is accomplished by updating the KMS key policy in Account B to grant kms:GenerateDataKey and kms:Encrypt permissions to the replication role in Account A.
Step-by-Step Solution
Key Concept
Amazon S3 Cross-Account Replication with KMS Encryption