A company has deployed a multi-VPC architecture in a single AWS Region with two peered VPCs: VPC A (CIDR ) and VPC B (CIDR ). VPC A hosts a fleet of autoscaling web servers within a security group named `sg-web`. VPC B hosts an internal microservice on Amazon EC2 instances within a security group named `sg-api`. The web servers must securely communicate with the internal microservice using HTTPS (port ). The network design must ensure that only the web servers in VPC A can access the microservice in VPC B, minimizing administrative overhead as the web server fleet scales.
Which configuration meets these requirements?
- ACreate a Network ACL rule for the microservice subnet in VPC B that allows inbound TCP port traffic from the web server security group (`sg-web`).
- Add an inbound rule to the internal microservice security group (`sg-api`) that allows TCP port traffic where the source is the web server security group (`sg-web`).Cevap
- CAdd an inbound rule to the internal microservice security group (`sg-api`) that allows TCP port traffic where the source is the CIDR block of VPC A ().
- DDeploy AWS Shield Advanced in VPC B and configure an access control policy to restrict inbound port traffic to the public IP addresses of the web servers in VPC A.
Cevap
Add an inbound rule to the internal microservice security group (`sg-api`) that allows TCP port traffic where the source is the web server security group (`sg-web`).
The correct configuration is to add an inbound rule to the internal microservice security group that allows traffic on port from the web server security group. AWS allows security groups to reference other security groups in peered VPCs within the same Region. This ensures that only the instances associated with the web server security group can access the microservice, automatically adapting as the web server fleet scales and avoiding the need to manage individual IP addresses or allow the entire VPC A CIDR block.
Adım Adım Çözüm
Anahtar Kavram
Security Group Referencing Across Peered VPCs
Tahmini Süre:1m 30s