Fix error configuring Terraform AWS Provider

by Daniel Pham
Published: Last Updated on 0 views

How to fix Error: error configuring Terraform AWS Provider: error validating provider credentials: error calling sts:GetCallerIdentity: operation error STS: GetCallerIdentity, https response error StatusCode: 403, RequestID: 86f71cc7-9d56-4f2e-abf6-bb36c8011db6, api error InvalidClientTokenId: The security token included in the request is invalid ?

Error: error configuring Terraform AWS Provider: error validating provider credentials: error calling sts:GetCallerIdentity: operation error STS: GetCallerIdentity, https response error StatusCode: 403, RequestID: 86f71cc7-9d56-4f2e-abf6-bb36c8011db6, api error InvalidClientTokenId: The security token included in the request is invalid.
 
   with provider["registry.terraform.io/hashicorp/aws"],
   on main.tf line 11, in provider "aws":
   11: provider "aws" {

Error configuring Terraform AWS Provider

fix-error-configuring-terraform-aws-provider
Error: error configuring Terraform AWS Provider: error validating provider credentials

I faced this error when I updated my Terraform code at this block:

provider "aws" {
  region                    = var.region
  shared_config_files       = ["/home/dungpham/.aws/config"]
  shared_credentials_files  = ["/home/dungpham/.aws/credentials"]
  profile                   = "default"
}

I just changed the profile and got the error. Why this happened?

This error caused by Terraform couldn’t get the permission to access the provider AWS.

You can see block provider above, we use the configurations from awscli and inside this one, we’re using IAM key and secret.

How to fix this error?

  • The first thing, you should check the configurations inside .aws folder. May there are some miss characters or waste characters.
  • The second thing, you login to your AWS account and check if your IAM key still in active.
  • If your IAM key still active then compare it with your current configurations inside .aws folder.
  • And if still not working, you can create a new IAM User with a new IAM key and secret then update the new one to your configurations inside .aws folder.

Conclusion

This error is not a serious problem but with someone newbie, it’s may make you worries a bit.

So I wrote my experience to make you feel better when see it. Cheers !

3 3 votes
Article Rating

You may also like

Subscribe
Notify of
guest
2 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
Ade
Ade
Guest
1 year ago

Thanks

DevOps Lite is a personal blog specializing in technology with main topics about DevOps, DevSecOps, SRE and System Administrator. Articles are shared for free and contributed to the community.

SUPPORT US

FOLLOW US

Subscribe my Newsletter for new blog posts. Stay updated from your inbox!

© 2021-2024 DevOpsLite.com – All rights reserved.

Please write sources “DevOpsLite.com” when using articles from this website.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

0
Would love your thoughts, please comment.x
()
x

Adblock Detected

Please support us by disabling your AdBlocker extension from your browsers for our website.