I am still learning AWS so please bear with me. I tried searching google but couldnt get any precise answer to my question. I am a CCIE myself so networking is not new to me.
When we create new EC2 instance in default VPC every instance gets a Public IP and Private IP. Private IP is assigned to the ENI. Perfect. Where is the public ip assigned? how its done? i think it should be NAT behind the scenes right? or else how can you assign a Public IP without actually assigning it somewhere.
Please confirm my doubt
I tried to find the answer in aws documentation but couldnt find it
2
Answers
Amazon has it’s own pool of public ip addresses, which gets assigned to your instances based on where you deployed them.
See here: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html
I’m not sure if you’re looking for a more in-depth answer.
But something to be aware of, is that AWS will start charging you for all active and waiting public ip addresses, due to the shortage.
See announcement: https://aws.amazon.com/blogs/aws/new-aws-public-ipv4-address-charge-public-ip-insights/
Behind the scenes, the public ip is VIP that is mapped to the private ip address using static nat.