AWS CLI for EBS snapshots

1.7k views Asked by At

I am trying to get AWS CLI going to backup my EC2 instances. I can't see why AWS don't make it easy to schedule this via the console but they don't so I am pushing ahead with CLI.

I installed on one of my instances. Problem 1, it won't work unless I setup a NAT instance as my instance has no public IP. Trying to avoid that so I used a server at a different ISP that does have a public IP. I setup the credentials and profiles using aws configure. I have config and credentials files in .aws directory. All should work. I try:

aws ec2 describe-instances --profile tmpevaluate

Could not connect to the endpoint URL: "https://ec2.us-west-2b.amazonaws.com/"

I tried

nslookup ec2.us-west-2b.amazonaws.com

but it doesn't resolve. Weird as it resolves on my Mac and DNS is working on the server I am trying it from as it can resolve any other domains I can think of. So to debug I installed and configured AWS CLI on my Mac. I know it can resolve ec2.us-west-2b.amazonaws.com. So I tried:

aws ec2 describe-instances --profile tmpevaluate

and get:

HTTPSConnectionPool(host='ec2.us-west-2b.amazonaws.com', port=443): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<botocore.awsrequest.AWSHTTPSConnection object at 0x10c0ac6d0>, 'Connection to ec2.us-west-2b.amazonaws.com timed out. (connect timeout=60)'))

I am at a loss. Something that should be so simple has me totally stumped and no one else seems to be having the same problem.

Ideas?

1

There are 1 answers

0
slayedbylucifer On BEST ANSWER

Use us-west-2 instead of us-west-2b in your Endpoint URL. Most probably, this would be the value of REGION in your configuration file that was created by running aws configure

us-west-2 is a region us-west-2b is an availability Zone in that region.

You should be connecting to the Region and not to a specific Availability Zone