Vertex Media Group is migrating a legacy media transcoding pipeline from VMware virtual machines to AWS. The solution must containerize the transcoding tasks and run them on Amazon ECS using the AWS Fargate launch type to minimize operational overhead. The container images will be stored in a centralized Shared Services AWS account's Amazon ECR repository, which is encrypted using an AWS KMS Customer Managed Key (CMK). The Application VPC where the ECS tasks will run has no internet access, and all communication must remain within the AWS private network. Which combination of actions should the Solutions Architect take to configure the networking and permissions for the ECS tasks? (Select TWO.)
- Configure the ECS task definition to use the awsvpc network mode, and deploy Interface VPC endpoints for Amazon ECR (ecr.api and ecr.dkr) and AWS KMS, along with a Gateway VPC endpoint for Amazon S3 in the Application VPC.Answer
- Grant the ECS task execution role in the Application account permissions to pull images from ECR and decrypt them using the KMS key. Configure the ECR repository policy and the KMS Customer Managed Key policy in the Shared Services account to allow access from the Application account.Answer
- CConfigure the ECS task definition to use the bridge network mode to enable task communication, and deploy Interface VPC endpoints for Amazon ECR and AWS KMS in the Application VPC.
- DConfigure the ECS task execution role to decrypt the image using the default AWS-managed KMS key (aws/ecr) in the Shared Services account, and configure cross-account access via the Application account's IAM policy.
Answer
Configure the ECS task definition to use the awsvpc network mode, deploy ECR and KMS Interface VPC endpoints, along with an S3 Gateway VPC endpoint, and grant the ECS task execution role cross-account permissions to pull from the ECR repository and decrypt using the Customer Managed Key (CMK) in the Shared Services account.
To support containerized tasks on AWS Fargate in a private VPC, the ECS task definition must use the awsvpc network mode. Since the VPC lacks internet access, the task must resolve and pull images via VPC endpoints. ECR requires Interface VPC endpoints (ecr.api and ecr.dkr) and a Gateway VPC endpoint for Amazon S3 (where ECR stores layers). Additionally, to pull images encrypted with a KMS CMK from a Shared Services account, the task execution role must be granted cross-account pull and decrypt permissions, and the ECR repository policy and KMS Customer Managed Key policy must explicitly allow cross-account access from the Application account. AWS-managed KMS keys cannot be shared cross-account, necessitating a Customer Managed Key.
Step-by-Step Solution
Key Concept
Modernizing legacy workloads using Amazon ECS on AWS Fargate requires configuring private connectivity via VPC endpoints (ECR, S3, KMS) and configuring cross-account access utilizing IAM roles and resource-based policies for Customer Managed Keys (CMKs) and ECR repositories.