More EC2 Topics
Private vs Public vs Elastic IP
Networking have two types of internet process address. IPv4, IPv6.
A public IP address allows internet to reach the host using internet. They are unique on the internet.
A private network has its own set of private IP address that the normal internet cannot access. They are private. The network is exposed only via an internet gateway IP address which allows communication to the outside world. However, the hosts that are inside the private network are allowed to communicate to each other using their respective private IP addresses.
Two different private network can have the same private IPs that is perfectly fine.
Elastic IPS
When you stop and start EC2 instance, the public IP is changed. If you need a fixed public IP then you will need Elastic IP. You attach it to one of the EC2 instance and as long as you don't delete it you will own a IPv4 IP address for your EC2 instance.
So even if you stop and restart your EC2 instance, it will have the same elastic IP.
You can only have 5 elastic IP account, avoid them if possible. Use random public IP and use DNS name to it.