0

I just launched a new clean ec2 instance in the same eu-west-2 and specified the subnet. All traffic internally and externally is enabled. Curl requests to http://169.254.169.254 return results and external requests also work (eg. google.com). However, requests to http://ec2.eu-west-2.amazonaws.com/ hang. Note that requests to https://ec2.eu-west-1.amazonaws.com/ resolve. My end aim is to use aws ec2 describe-tags (I know there are other methods, but I want to understand why this method works on one instance and not on another). I SSH connected to another instance in the region (on the same subnet) and all works perfectly. I have tried this request as an IAM user with and without the ec2:DescribeTags permission and both hang. Both servers have the same nameserver (and so do instances in the different availability zones within the region). Why isn't Curl working internally on these new instances but not the old ones? Is it a route53 issue; a vpc issue; or a different permission?

Extra info: If I create the instance in a different region, such as ap-east-1, and then query the above locations or https://ec2.ap-west-1.amazonaws.com/, it resolves. There are other instances on the eu-west region, including a rabbit mq tunnel and a database. Could these be a part of the problem?

4
  • Note that curl default is https (if you want to avoid it you should use -k for insecure mode) Commented Oct 13, 2023 at 14:40
  • There's a difference between the AWS metadata service's IP address and the default DNS domain. There is an AWS service waiting to accept connections/requests at the IP address. There is no AWS service waiting for connections to the DNS domain name. aws ec2 describe-tags uses the AWS API and not the IP address or the DNS domain name. Three different things with different documented behaviors. Commented Oct 14, 2023 at 1:40
  • @SottoVoce Thanks. If you've set your region as eu-west-2, aws ec2 describe-tags connects to ec2.eu-west-2.amazonaws.com but in --debug mode this connection stage hangs. Any ideas why? Thanks. Commented Oct 17, 2023 at 8:53
  • Your descriptions of subnet and VPC configuration, descriptions of the aws ec2 describe-tags commands, and which EC2 instances work and don't work are too vague to troubleshoot definitively. My best guess is that you've launched new EC2 instances in private subnets that don't have NAT gateways, or you've launched new EC2 instances in public subnets but haven't given them public IP addresses. Commented Oct 17, 2023 at 13:47

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.