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

Get AWS Networking Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.