Not talking about Elastic IPs which are static IPs.
This question is about those public IPs you can get when setting up a new instance, in order to ssh into the instance. The ones that change each time you stop & start the instance.
Is there a cost associated with this IP?
Is there a limit to the number of such IPs you can obtain? Say you start 20 instances, each with a public IP to ssh into it? Or hundreds?
If you set up such public access at time of instance creation, but then set up a firewall within using ports such that you can ssh through port forwarding and no longer need these public IPs, can they be given up?
Edit: I should add - each of these servers is similar but serves a different need, so needs some level of customization, including on the local firewall on the server. So it needs access initially. While its great to have direct access from the internet, it seems that there would be a limit to the number of IPs available and also some cost associated
Yep, it hard to find those infos because AWS didn’t mentioned directly in their docs! But when you be more familiar with AWS you will know how and where to find such those of info!
Still wondering how many IPv4 AWS owned? - the answer is they have ~ 53 Million IPv4 addresses (and maybe expand more) which cost about over $2.5 billion Biden dollars.
While it is true that they will need lots of IP addresses for each EC2 Instance it is not really necessary in real world scenario. Most Production servers are usually behind Bastion hosts. You SSH to these and then use the Private IPs of the servers. Also the servers need to be in “running” state in order to retain the Public IP that AWS assigns. If you stop and start the server they are assigned a new Public IP again.
Actually I thought you can put an EC2 instance in a VPC that has no public interface and then it won’t get provisioned a public IP. Same as how you can enable or disable ipv6 provisioning.