A developer is deploying a containerized API on AWS Fargate within a private subnet of a custom VPC. The API needs to read and write data to an Amazon Aurora PostgreSQL database located in a different private subnet within the same VPC. Additionally, the API must fetch sensitive API keys from AWS Secrets Manager. There is no route to the internet or any NAT Gateway configured in the VPC. Which set of configurations is required to establish these connections securely?
- Create an interface VPC endpoint (AWS PrivateLink) for Secrets Manager, configure its security group to allow inbound HTTPS traffic from the Fargate task, and configure the Aurora security group to allow inbound PostgreSQL traffic from the Fargate task's security group.Cevap
- BDeploy a NAT Gateway in the Fargate task's private subnet, add a route in its route table pointing 0.0.0.0/0 to the NAT Gateway, and configure the Aurora security group to allow inbound traffic from the NAT Gateway's private IP address.
- CModify the IAM trust policy of the ECS task execution role to trust secretsmanager.amazonaws.com and add a policy allowing secretsmanager:GetSecretValue, then configure the Aurora routing table to propagate routes from the Fargate subnet.
- DMigrate the API keys from AWS Secrets Manager to Systems Manager Parameter Store, as Parameter Store is natively accessible within private subnets without requiring VPC endpoints or NAT gateways, and open port 5432 on the Aurora subnet's Network Access Control List (NACL) for inbound and outbound traffic.
Cevap
Create an interface VPC endpoint (AWS PrivateLink) for Secrets Manager, configure its security group to allow inbound HTTPS traffic from the Fargate task, and configure the Aurora security group to allow inbound PostgreSQL traffic from the Fargate task's security group.
The correct option establishes a private, secure path to Secrets Manager via AWS PrivateLink within the VPC, and allows the Fargate task to securely communicate with the Aurora database in another private subnet of the same VPC using security groups.
Adım Adım Çözüm
Anahtar Kavram
VPC Security Groups and Private VPC Endpoints
Tahmini Süre:2m 0s