An enterprise runs an application on Amazon EC2 instances in a private subnet within VPC A in Account A. The application must retrieve sensitive files from an Amazon S3 bucket in Account B. The S3 bucket is encrypted using a Customer Managed Key (CMK) in Account B. VPC A has no internet gateway, NAT gateway, or virtual private gateway configured. All traffic must remain within the AWS network, and the solution must enforce least-privilege security.
Which two actions should a Solutions Architect take to configure this connection? (Select two.)
- Create an S3 Gateway VPC Endpoint and a KMS Interface VPC Endpoint in VPC A, and associate the S3 gateway endpoint with the VPC A route tables.Answer
- Configure the KMS key policy of the Customer Managed Key in Account B to allow the application's IAM role in Account A to perform kms:Decrypt operations.Answer
- CConfigure the S3 bucket to use the AWS-managed key (aws/s3) in Account B, and update the application's IAM policy in Account A to allow decryption using this key.
- DEstablish a VPC Peering connection between VPC A and a VPC in Account B, and route S3 traffic from VPC A through a Gateway VPC Endpoint deployed in Account B's VPC.
- EAttach a Service Control Policy (SCP) to the Organization root that grants the application's IAM role in Account A permissions to perform s3:GetObject and kms:Decrypt on resources in Account B.
Answer
Create an S3 Gateway VPC Endpoint and a KMS Interface VPC Endpoint in VPC A, and configure the KMS key policy of the Customer Managed Key in Account B to trust the cross-account IAM role.
The correct solution involves setting up both S3 and KMS VPC endpoints in VPC A to ensure the network traffic remains private. S3 traffic goes through the gateway endpoint, and KMS decryption calls go through the KMS interface endpoint. For access, since the S3 objects are encrypted with a Customer Managed Key, the key policy in Account B must be updated to grant decryption rights to the cross-account IAM role in Account A.
Step-by-Step Solution
Key Concept
Cross-account access to encrypted S3 resources from a private VPC requires a local S3 Gateway VPC Endpoint, a local KMS Interface VPC Endpoint, and explicit permission grants in both the S3 bucket policy and the KMS Customer Managed Key policy.