A media company hosts a microservices application across two different virtual private clouds (VPCs) in the same AWS Region: VPC A () and VPC B (). The VPCs are connected using a VPC peering connection. The web microservice in VPC A needs to query a PostgreSQL database cluster running on Amazon EC2 instances in VPC B.
Which configuration should a solutions architect implement to secure network access to the database using the principle of least privilege?
- Configure the database security group in VPC B to allow inbound TCP port traffic from the security group of the web microservice in VPC A.Answer
- BConfigure the database security group in VPC B to allow inbound TCP port traffic from the CIDR block of VPC A ().
- CConfigure the Network ACL of the database subnet in VPC B to allow inbound TCP port traffic from the security group of the web microservice in VPC A.
- DConfigure the database security group in VPC B to allow inbound TCP port traffic from the public IP addresses of the web microservice instances in VPC A.
Answer
Configure the database security group in VPC B to allow inbound TCP port traffic from the security group of the web microservice in VPC A.
Referencing the security group ID of the web microservice in the database's security group rule is the recommended AWS best practice for peered VPCs. This ensures that only the instances explicitly associated with the web microservice security group can access the PostgreSQL database on port , maintaining strict isolation.
Step-by-Step Solution
Key Concept
Security Group Referencing across VPC Peering
Estimated Time:1m 30s