Errors while connecting an EC2 instance in a VPC
There can be multiple reasons for getting such an error; a few of them are mentioned following:
- EC2 created in the wrong subnet group or private subnet
- Instance doesn't have a public IP or you are trying to connect with a private IP
- SSH/RDP port is not opened in the security group or the security group is not attached to the instance
Getting ready
You should have access to EC2 and VPC to view and modify the resources.
How to do it...
The following steps are to be followed:
- Start by checking the IP of the instance. Verify that you are using the correct IP address. Follow the following steps to check the IP:
- Log in to the
AWS Console
|EC2
|Instances
|Instance
.
- Log in to the

AWS EC2 Console
- Check that your instance has either a public IP address or an Elastic IP address associated with it in the case of public instances. Follow the following steps to check the Associated Elastic IP:
- Log in to the
AWS Console
|EC2
|Elastic IPs
|Allocate new address
.

Allocate Elastic...