问题
I am new to aws, I am trying to use aws-cli to connect aws as I am confortable with commandline, and want to use to write the script to automate the process.
However I am getting error as below:
_
attempt_number, caught_exception)
File "/usr/local/lib/python2.7/site-packages/botocore/retryhandler.py", line 359, in _check_caught_exception
raise caught_exception
EndpointConnectionError: Could not connect to the endpoint URL: "https://ec2.ap-southeast-1a.amazonaws.com/"
2017-07-08 20:30:52,763 - MainThread - awscli.clidriver - DEBUG - Exiting with rc 255
Could not connect to the endpoint URL: "https://ec2.ap-southeast-1a.amazonaws.com/"
I have setup the profile user as in the config file.
[profile joey2]
output = json
region = ap-southeast-1a
the credential such as api key and secret is configured properly.
Could someone help to figure out what is cause of this issue. highly appreciate for any advice?
回答1:
ap-southeast-1a
is not a valid AWS Region, you need to use ap-southeast-1
instead. You're getting that connection error because https://ec2.ap-southeast-1a.amazonaws.com/ (which is what your input region is attempting to resolve to) does not exist. You can verify this via the EC2 Region documentation.
Region Name: Asia Pacific (Singapore)
Region: ap-southeast-1
Endpoint: ec2.ap-southeast-1.amazonaws.com
Further Reading
- AWS Regions and Endpoints
来源:https://stackoverflow.com/questions/44986296/could-not-connect-to-aws-services-using-aws-cli