Unable to use backend S3 config with local endpoint

Hi,

In my company we have a private Scality S3 host to use as a bucket to store our tfstate files.

After setting AWS environmental variables :

Blockquote
export AWS_ACCESS_KEY_ID=“*****************”
export AWS_SECRET_ACCESS_KEY=“*************”
export AWS_DEFAULT_REGION=eu-west-3
export AWS_CA_BUNDLE=/usr/local/share/ca-certificates/enpoint.crt
export AWS_S3_ENDPOINT=“my-internal-enpoint.fr

and adding the terraform backend s3 section below :

Blockquote
terraform {
backend “s3” {
bucket = “demo-terraform”
region = “eu-west-3”
access_key = “***********************”
secret_key = “*************************”
skip_credentials_validation = true
key = “terraform/tfstate”
endpoint = “my-internal-enpoint.fr
}
}

we are not able to retrieve local server. We are not able to retrieve local server. The “terraform init” works fine, but the “terraform plan” doesn’t :

Blockquote
Error: error using credentials to get account ID: error calling sts:GetCallerIdentity: RequestError: send request failed
caused by: Post https://sts.amazonaws.com/: dial tcp: lookup sts.amazonaws.com on 1.2.3.4:53: no such host

I already verified the credentials and everything seams to be ok. Do you know why the plan action tries to reach sts.amazonaws.com even after I have precised the endpoint to use?

Thank you.
Best regards.
B.C