- Newest
- Most votes
- Most comments
Which OS are you running, and does it have Instance Connect pre-installed? https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-connect-set-up.html
There are differences with the default VPC (that you've worked with before) and a custom VPC that you're using now. The default VPC is already setup with an internet gateway, and subnets whose routing tables already have a route to the internet gateway. The custom VPC doesn't have any of this, and you're going to have to setup these components and get them all working together.
As you've already provisioned an EC2 instance into the custom VPC it means at least one subnet will have been created. The next thing to look at would be making sure it is reachable, the details are in here https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Internet_Gateway.html (actually many of the items in the pane on the left hand side may come in useful at some point).
There's not enough information to troubleshoot this issue - for example, how is the VPC configured? Subnets, route tables, internet gateway and so on. The first place I'd go to is the EC2 Instance Connect documentation which lists the prerequisites for getting the service to work.
Relevant content
- Accepted Answerasked 6 months ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated 2 years ago
I got it. My custom VPC had two subnets, one private and one public. I used the private one to mount it to my lambda function, so I assumed the private subnet would also work for the EC2 instance, but it didn't. However, when I changed the EC2 instance subnet to the public one, I was able to connect.