Accessing Your EC2 Instances
Access to your EC2 instances from the internet requires ensuring adequate levels of security and enforcing policies or rules to limit the type of traffic allowed into your instances. You can remotely connect to your instances over the internet using Secure Shell (SSH) for Linux-based EC2 instances or Remote Desktop Protocol (RDP) for Windows-based EC2 instances.
How you connect to your EC2 instance also depends on its placement within your VPC. For example, instances placed within public subnets that have direct access to the internet can be easily accessed as long as security groups allow inbound connections to relevant ports and your VPC has an internet gateway. Furthermore, your Network Access Control Lists (NACLs) must allow both inbound and outbound connections to the subnet that hosts your EC2 instance.
As depicted in the following diagram, as long as the aforementioned configuration is in place, you can connect to your instance using SSH or...