Public IP addresses
AWS owns a large but finite number of public IP addresses. When you launch an instance, you can choose to have a public IP randomly assigned to it. You only need a public IP address if you want the instance to be reachable from the internet, so it is optional. When you create a subnet, which we will do later, you can set the subnet so that instances that launch in it will get a public IP automatically. However, when launching an instance, you can choose to override that and not receive a public IP.
There is no cost for assigning public IPs to your instance; however, to follow best security practices, you shouldn't get a public IP for your instance if you don't need it. One of the nice features of EC2s is that you can stop ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access