Can't connect to an AWS EC2 instance with cURL
amazon-ec2, amazon-web-services
Solution
This could be many things:
Review the AWS Security Groups. You probably need to add an incoming traffic exception rule for port 80 in the Security Group that's attached to your instance. For more information refer to the documentation.
If your EC2 instance is in a VPC, you need to make sure networking has been set up properly with an Internet Gateway and proper Routing Table rules. For reference, there is a nice example of a typical VPC setup here.
Additionally, if the above don't solve the issue, check the EC2 instance's OS firewall rules and that the HTTP server is running.
Problem
Can anyone tell me why can't I connect to an AWS EC2 instance? I am using cURL to connect like this: `curl ec2-54-xxx-xx-xxx.eu-west-1.compute.amazonaws.com` But I am getting the following error: `curl: (7) couldn't connect to host` Can anyone tell me what might be wrong? I haven't previously worked with AWS.