How to Assign an Elastic IP address to your EC2 Instance

Jan 17, 2019 How to set up a custom domain for your EC2 instance The default way to access EC2 instances is by typing its IP address (192.168.0.1) in a browser. This is great for testing, but when going public with your blog or portfolio website, it makes more sense to have a domain name such as "example.com" instead. Using Terraform to Create an EC2 Instance Within a Public Jan 18, 2019

Once an EC2 instance is launched, it's assigned a private IP address at boot time. An instance's private IP address will never change during the lifetime of that instance. As per AWS, when an instance is launched in EC2-Classic, it is automatically assigned a public IP address to the instance from the EC2-Classic public IPv4 address pool.

For example, if you're connecting to a server, consider allowing traffic on HTTP port 80 and HTTPS port 443, using the destination IP address 0.0.0.0/0. For more information, see Amazon EC2 security groups for Linux instances or Amazon EC2 security groups for Windows instances.

Troubleshoot Connecting to an Instance in a VPC

Remember, when an instance is launched into EC2, Amazon will randomly assign it both a public and private IP address. Amazon has a pool of public IP addresses that's been reserved for use within EC2. Therefore, when you launch an instance in EC2, it might be randomly assigned a public IP address that someone was just using to host their Troubleshoot Connecting to an Instance in a VPC Jul 19, 2016