-1

I am trying to run AWS command from my local MAC, but the connection keeps timing out and traceroute is unable to get to my s3.us-east.amazonaws.com.

I have run aws configure, on both my local mac and my ec2. It works on ec2 (not surprising), but not on my local MAC.

I have a single user who has sysadmin access.

As I said, AWS works on my ec2 instance and the following command yields the following.

Is there something else I need to do to get the AWS CLI to connect from my MAC?

    [root@ip-172-31-26-40 ec2-user]# aws s3 ls
2019-11-19 19:55:14 wildrydes.denis.putnam
[root@ip-172-31-26-40 ec2-user]# aws s3api list-buckets
{
    "Owner": {
        "DisplayName": "denisputnam",
        "ID": "22873dab63c6750106aa2bf9f5584754d9b5449067a07c5ab57841967022f3fc"
    },
    "Buckets": [
        {
            "CreationDate": "2019-11-19T19:55:14.000Z",
            "Name": "wildrydes.denis.putnam"
        }
    ]
}
[root@ip-172-31-26-40 ec2-user]#

Debug output:

Traceback (most recent call last):
  File "site-packages/botocore/endpoint.py", line 200, in _do_get_response
  File "site-packages/botocore/endpoint.py", line 244, in _send
  File "site-packages/botocore/httpsession.py", line 287, in send
botocore.exceptions.ConnectTimeoutError: Connect timeout on endpoint URL: "https://iam.us-east.amazonaws.com/"
2019-12-04 17:20:51,304 - MainThread - botocore.hooks - DEBUG - Event needs-retry.iam.ListUsers: calling handler <botocore.retryhandler.RetryHandler object at 0x7ff818983250>
2019-12-04 17:20:51,304 - MainThread - botocore.retryhandler - DEBUG - retry needed, retryable exception caught: Connect timeout on endpoint URL: "https://iam.us-east.amazonaws.com/"
Traceback (most recent call last):
  File "site-packages/urllib3/connection.py", line 157, in _new_conn
  File "site-packages/urllib3/util/connection.py", line 84, in create_connection
  File "site-packages/urllib3/util/connection.py", line 74, in create_connection
socket.timeout: timed out
7
  • Do you mean s3.us-east-1.amazonaws.com? Can you reach other internet locations, like Google? Are other AWS services reachable, like EC2 (aws ec2 describe-instances) or STS (aws sts get-caller-identity)? Are you using custom endpoints? Are you routing through a proxy that restricts access? Commented Dec 4, 2019 at 20:26
  • I can ssh into the ec2 instance. Commented Dec 4, 2019 at 22:04
  • And what about other AWS service endpoints? Do the other awscli examples I gave you work? Commented Dec 4, 2019 at 22:06
  • No, the other calls don't work. Commented Dec 4, 2019 at 22:24
  • I added some debug output and made sure I am running aws2. Commented Dec 4, 2019 at 22:30

1 Answer 1

4

This might have been answered here:

AWS S3 CLI - Could not connect to the endpoint URL

Essentially, perhaps your config file contains "us-east" instead of "us-east-1"

(The IAM timeout is trying to hit iam.us-east....But I dont think us-east without the 1 is an official region.)

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you, Daniel and jarmod!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.