terraform plan
Acquiring state lock. This may take a few moments…
╷
│ Error: error configuring Terraform AWS Provider: error validating provider credentials: error calling sts:GetCallerIdentity: RequestError: send request failed
│ caused by: Post “https://sts.amazonaws.com/”: dial tcp: lookup sts.amazonaws.com on 100.64.0.1:53: no such host
│
│ with provider[“Terraform Registry”],
│ on terraform.tf line 1, in provider “aws”:
│ 1: provider “aws” {
│
╵
Releasing state lock. This may take a few moments…
Your private network environment appears to block access to the internet.
not really. anything else you could think of from the terraform perspective?
You literally have an error message telling that your DNS server doesn’t think sts.amazonaws.com exists.
I’m able to do terraform plan on other aws account. This error was specific to one account.
And the terraform version used is different.
Have you figured out what is the problem?
I am having the same issue. I have two folders with terraform scripts.
Each folder contains separate piece of infrastructure with its own state stored in S3.
Configuration in each folder is identical in terms of aws provider region etc…
I can successfully run terraform plan from inside one folder but always get the tcp: lookup sts.ap-northeast-2.amazonaws.com on 192.168.XX.XX:53 no such host when running from another folder.
All used to work 6 months ago, have no clue what got rotten.
Ah I just figured it out.
TL;DR: it was the version of AWS provider that was not working.
The folder where everything was fine had the version 3.75.2 of the aws provider that it pulled a while ago, cached and never bothered to fetch a newer version.
The folder where the terraform plan
was failing was fetching a fresh version, which was 3.76.0 (latest permitted by my version restriction in the config). And this particular version was not working for me. Once I set the strict version rule for 3.75.2 all is working fine now.