An enterprise runs an application hosted on Amazon ECS tasks using the AWS Fargate launch type inside a private subnet of VPC A in Account A (Production). The application needs to retrieve database credentials from AWS Secrets Manager in Account B (Shared Services). The secret is encrypted using an AWS KMS Customer Managed Key (CMK) in Account B. In addition, the application must resolve private DNS records for services in Account B, which are defined in a Route 53 Private Hosted Zone (PHZ) in Account B.
Currently, all traffic from VPC A to Secrets Manager traverses the public internet via NAT Gateways, and the application cannot resolve the private DNS names of the resources in Account B. The Solutions Architect must strengthen the identity, access, and network security posture of this existing solution by keeping all traffic within the AWS private network and using least-privilege access.
Which TWO actions should the Solutions Architect take to meet these requirements?
- Create an Interface VPC Endpoint for AWS Secrets Manager in VPC A. Update the key policy of the Customer Managed Key in Account B to grant kms:Decrypt permissions to the ECS task role in Account A. Attach an IAM policy to the ECS task role in Account A that permits the secretsmanager:GetSecretValue action.Cevap
- From Account B, authorize the association of the Route 53 Private Hosted Zone with VPC A using the AWS CLI or SDK. From Account A, associate the Route 53 Private Hosted Zone with VPC A.Cevap
- CEncrypt the secret in Account B using the default AWS managed key (aws/secretsmanager), and modify the AWS managed key policy to grant the ECS task role in Account A decrypt permissions.
- DAttach a Service Control Policy (SCP) to the Organizational Unit (OU) containing Account A that grants the ECS task role the secretsmanager:GetSecretValue and kms:Decrypt permissions, removing the need for local IAM policies.
- ERoute DNS queries from VPC A to the Amazon-provided DNS server () in VPC B over a Transit Gateway attachment, without associating the Private Hosted Zone with VPC A.