AWS Certified Solutions Architect – Professional — Question 871

A user is planning to host a web server as well as an app server on a single EC2 instance which is a part of the public subnet of a VPC.
How can the user setup to have two separate public IPs and separate security groups for both the application as well as the web server?

Answer options

Correct answer: B

Explanation

To host two services on a single EC2 instance with separate public IPs and security groups, you must attach two Elastic Network Interfaces (ENIs) to the instance and associate a separate Elastic IP (EIP) and security group with each. AWS does not automatically assign public IPs to secondary network interfaces, which makes option C incorrect. Additionally, a single EC2 instance cannot be placed in multiple subnets at the same time, ruling out option A.