简体   繁体   中英

Is it necessary to set public ip on ec2 instance behind internet facing ELB in AWS?

Is it necessary to set public ip on ec2 instance behind ELB which is internet facing in AWS?

I saw many examples of instance in public subnet and the instance is enabled a public ip but I wonder why it's required if there is internet facing alb in front of a instance.

I think if there is internet facing ALB, it would be fine if I disable a public ip on ec2 instance in public subnet because a client get reach to alb and alb can route the request to a instance which have only private ip address.

Am I correct?

You're correct. In fact the EC2 instance can even be on a private subnet and not a public subnet, as long as you allow traffic from the ALB's public subnet through the instance's security groups.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM