我正在私有VPC中的AWS区域us-west-2(俄勒冈)中运行Terraform。因此,我正在使用VPC endpoints公开STS API并按如下所示在Terraform中覆盖此端点:
provider "aws" {
endpoints {
sts = "https://sts.us-west-2.amazonaws.com/"
}
}
不幸的是,这给出了以下错误:
provider.aws: error validating provider credentials: error calling sts:GetCallerIdentity: SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
什么可能导致此问题?在公共VPC中应用相同的Terraform代码但不覆盖端点的情况符合预期。
我检查过的东西:
版本:
terraform version
:Terraform v0.11.13 terraform-provider-aws
:v2.17.0 答案 0 :(得分:1)
terraform似乎没有在将URL发送到AWS之前对其进行清理:
provider "aws" {
endpoints {
sts = "https://sts.us-west-2.amazonaws.com" # No trailing slash
}
}
对我来说一切正常,反斜杠会导致您的错误