I am running Terraform in AWS region us-west-2 (Oregon) in a private VPC. Because of this I am using VPC endpoints to expose the STS API and am overriding this endpoint in Terraform as follows:
provider "aws" {
endpoints {
sts = "https://sts.us-west-2.amazonaws.com/"
}
}
Unfortunately this gives the following error:
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.
What could be causing this issue? Applying the same Terraform code without the endpoint override in a public VPC worked as expected.
Things I have checked:
Versions:
terraform version: Terraform v0.11.13terraform-provider-aws: v2.17.0It seems like terraform is not sanitizing the URLs before sending them to AWS:
provider "aws" {
endpoints {
sts = "https://sts.us-west-2.amazonaws.com" # No trailing slash
}
}
Just works fine for me, while with the trailing slash it results in your error
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With