Terraform Error : validating provider credentials

Error

C:\Users\Rajesh Kumar\Desktop\Terarform\proj1>terraform plan

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: validating provider credentials: retrieving caller identity from STS: operation error STS: GetCallerIdentity, https response error StatusCode: 403, RequestID: 0604bfc9-6495-4ab4-8a3a-5c9261c747b5, api error InvalidClientTokenId: The security token included in the request is invalid.
│
│   with provider["registry.terraform.io/hashicorp/aws"],
│   on providers.tf line 18, in provider "aws":
│   18: provider "aws" {
│
╵

Answer

You must set AWS Provider credentials as per the cloud specification. Check below doc

https://registry.terraform.io/providers/hashicorp/aws/latest/docs

RIGHT CODE CAN BE LIKE THIS

provider "aws" {
  region     = "us-east-1"
  access_key = "SSSSSSSSSSSSSSSS"
  secret_key = "oSSSSSSSSSSSSSSSSSSSSSSS"
}
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x