NovusPay is modernizing its transaction processing engine by migrating it from on-premises virtual machines to Amazon ECS on AWS Fargate in a production AWS account. The container images will be stored in a centralized Amazon ECR repository located in a separate Shared Services AWS account. To comply with strict financial regulations, the ECS tasks must run in private subnets with no route to the internet, and all network traffic to download container images and decrypt keys must be routed privately within the AWS network. The ECR repository must be encrypted at rest, and the production ECS tasks must be able to pull images securely. Which combination of actions should a solutions architect take to meet these requirements? (Select TWO.)
- In the production VPC, create Interface VPC Endpoints (AWS PrivateLink) for com.amazonaws.region.ecr.dkr, com.amazonaws.region.ecr.api, and com.amazonaws.region.kms with Private DNS enabled. Attach a security group to these endpoints that allows inbound HTTPS traffic on port 443 from the security group associated with the Fargate tasks.Cevap
- Configure the Shared Services ECR repository to use a Customer Managed Key (CMK) for encryption. Update the CMK key policy to grant the production account's ECS task execution role permissions for kms:Decrypt and kms:DescribeKey. In the ECS task definition, configure the network mode to awsvpc.Cevap
- CIn the production VPC, create Interface VPC Endpoints for com.amazonaws.region.ecr.dkr, com.amazonaws.region.ecr.api, and com.amazonaws.region.kms. In the ECS task definition, configure the network mode to bridge to enable container port mapping and link the task container to the ECS host network.
- DCreate a Route 53 Private Hosted Zone for ECR in the Shared Services account. Associate this hosted zone only with the Shared Services VPC, and configure a Transit Gateway static route from the production VPC to resolve ECR DNS queries via the Shared Services resolver.
- EConfigure the Shared Services ECR repository to use the AWS-managed KMS key (aws/ecr) for encryption. Modify the key policy in the Shared Services account to grant the production account's ECS task execution role permissions for kms:Decrypt and kms:DescribeKey.
Cevap
Create Interface VPC Endpoints for ECR and KMS in the production VPC with Private DNS enabled, and configure the Shared Services ECR repository with a Customer Managed Key (CMK) that grants the production account's ECS task execution role access to decrypt the key, while using the awsvpc network mode in the task definition.
To support private cross-account image pulling on AWS Fargate without internet routing, the production VPC must have Interface VPC Endpoints (PrivateLink) configured for both ECR endpoints (api and dkr) and KMS, with private DNS enabled so the tasks resolve the endpoints locally. Additionally, Fargate tasks must use the awsvpc network mode. Because the ECR repository is in a separate account, it must be encrypted with a Customer Managed Key (CMK) rather than the default AWS-managed key, because the policy of an AWS-managed key cannot be altered to grant cross-account permissions to the production account's ECS task execution role.
Adım Adım Çözüm
Anahtar Kavram
Configuring private cross-account image pulling for AWS Fargate using VPC interface endpoints and custom KMS key policies.
Tahmini Süre:3m 0s