Can't connect to AWS EC2 instance from internet

Solution 1:

Apparently all new EC2 instances are created inside a Virtual Private Cloud at Amazon. This means traffic is not routed from the internet to the EC2 host until a few more things are set up. The things to check are:

  • subnet association to the vpc
  • existence of an internet gateway on the vpc
  • association of the subnet to a routing table
  • a new rule in the routing table which routes traffic from the internet to the EC2 host and back

Here is a diagram of this most basic setup from this article at AWS knowledge base support.

enter image description here

I followed this article doing the steps I listed in the bullet list above, and now I can connect on ssh and any other port allowed in the inbound rules for my EC2 host's security group.