Apex Healthcare is modernizing its prescription processing application by migrating it to AWS. The application will be deployed as containerized tasks using Amazon ECS on AWS Fargate in a VPC in the Production account. The container images must be securely pulled from a centralized Amazon ECR repository in the Shared Services account. To meet regulatory compliance, the ECR images are encrypted at rest using AWS KMS, and all image pull traffic must remain within the AWS network without traversing the public internet.
Which TWO configurations must a solutions architect perform to establish this architecture? (Select TWO.)
- In the Shared Services account, encrypt the ECR repository using an AWS KMS customer managed key, and update the key policy to grant the ECS Task Execution IAM Role in the Production account permissions to decrypt using the key.Answer
- In the Production account, create Interface VPC endpoints for ECR in the VPC where the tasks are deployed, and configure a Gateway VPC endpoint for Amazon S3 in the same VPC.Answer
- CIn the Shared Services account, encrypt the ECR repository using the default AWS-managed KMS key (aws/ecr), and modify its key policy to grant the ECS Task Execution IAM Role in the Production account permissions to use the key.
- DIn the Production account, configure the ECS task definition to use the host network mode to bypass the need for interface VPC endpoints and route traffic directly to ECR.
- EIn the Shared Services account, create a Route 53 Private Hosted Zone for the ECR DNS name, and associate it with the Production account's VPC to enable private ECR resolution without deploying VPC endpoints.
Answer
In the Shared Services account, encrypt the ECR repository using an AWS KMS customer managed key, and update the key policy to grant the ECS Task Execution IAM Role in the Production account permissions to decrypt using the key. Additionally, in the Production account, create Interface VPC endpoints for ECR in the VPC where the tasks are deployed, and configure a Gateway VPC endpoint for Amazon S3 in the same VPC.
To support private, cross-account ECR image pulls under KMS encryption, you must use a Customer Managed Key in the repository account to delegate decryption permissions to the target account's task execution role. Furthermore, you must establish Interface VPC endpoints in the consumer VPC to allow private communication to ECR API endpoints, alongside a Gateway VPC endpoint for S3 because ECR stores its image layers in S3 buckets.
Step-by-Step Solution
Key Concept
Cross-account ECR image pulling with KMS encryption and private endpoint routing on AWS Fargate