When you launch an instance, it is automatically assigned a public IP address by AWS from its public IP IPv4 address pool. You cannot manually associate or dissociate a public IP from your instance.
To change your public IP, stopping and starting an instance would be one of the easiest ways. You don't have to terminate the instance, just stop and start. Although stopping and terminating an instance is actually equivalent from the billing perspective.
Note: If you launch an instance in a non-default VPC, you can control whether your instance receives a public IP address as follows:
- You can enable or disable public IP addressing feature during launch.
- You can modify the public IP addressing attribute of your subnet.