amazon-web-services - 无法使用 aws-cli 连接到 aws 服务

标签 amazon-web-services aws-cli

我是 aws 的新手,我正在尝试使用 aws-cli 连接 aws,因为我熟悉命令行,并且想使用它来编写脚本来自动化该过程。

但是我收到如下错误:

_
    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/"

我已经在配置文件中设置了配置文件用户。

[profile joey2]
output = json
region = ap-southeast-1a

api key 和 secret 等凭证配置正确。

谁能帮忙找出这个问题的原因。 非常感谢任何建议?

最佳答案

ap-southeast-1a 不是有效的 AWS 区域,您需要改用 ap-southeast-1。您收到该连接错误是因为 https://ec2.ap-southeast-1a.amazonaws.com/ (这是您的输入区域试图解析的内容)不存在。您可以通过 EC2 Region documentation 验证这一点.

区域名称:亚太地区(新加坡)
地区: ap-southeast-1
端点: ec2.ap-southeast-1.amazonaws.com

延伸阅读

关于amazon-web-services - 无法使用 aws-cli 连接到 aws 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44986296/

相关文章:

amazon-web-services - 使用 AWS CLI 将 RDS 分配给 VPC

amazon-web-services - Cognito Lambda 触发套接字超时

node.js - 导入 Cognito 时遇到问题, "AmazonCognitoIdentity is not defined"

amazon-web-services - 有没有办法导出和导入 Amazon Connect - 联系流

aws-cli - 查询多个值

amazon-web-services - AWS CLI 与控制台和 CloudFormation 堆栈

amazon-web-services - AWS Batch 作业卡在可运行状态

amazon-web-services - 部署 : The role defined for the function cannot be assumed by Lambda 时出现 AWS Lambda 和 IAM 错误

amazon-web-services - 如何在 AWS 中的特定时间触发 Lambda 函数?

bash - 如何关闭 AWS CLI 返回值的寻呼机?