我正在学习 terraform,并且正在将资源部署到
ap-south-1
。但是,我注意到我无法将资源部署到除 us-east-1
之外的任何区域。为了确保我使用正确的访问密钥,我尝试使用根帐户访问密钥。还是同样的问题。
应用 terraform apply 后,我收到以下错误:-
Error: Retrieving AWS account details: validating provider credentials: retrieving caller identity from STS: operation error STS: GetCallerIdentity, exceeded maximum number of attempts, 25, https response error StatusCode: 0, RequestID: , request send failed, Post "https://sts.ap-south- 1.amazonaws.com/": net/http: TLS handshake timeout
│
│ with provider["registry.terraform.io/hashicorp/aws"],
│ on demo.tf line 11, in provider "aws":
│ 11: provider "aws" {
│
我做了以下事情:-
使用管理员帐户访问权限和密钥进行测试
使用根帐户凭据进行测试(以防管理员凭据出现一些问题)
确保有一个默认区域(设置为 ap-south-1)
确保Keys中没有空格
确保帐户中的区域
ap-south-1
处于活动状态
您的提供者定义中是否有
endpoints
配置块?根据错误消息,看起来 sts
的值中有一个额外的空格:
sts.ap-south- 1.amazonaws.com
如果没有,请分享您的提供商定义,并说明您在哪里运行
terraform apply
- 您自己的计算机还是 AWS 上的实例?如果从您自己的计算机上,请验证您是否可以连接到 sts.ap-south-1.amazonaws.com,因为从错误消息中您会收到超时。