Getting error while running terraform apply in the playground

Hi Team,

I am getting the below error while executing terraform apply.

Plan: 1 to add, 0 to change, 0 to destroy.

aws_instance.test-servers: Creating…

│ Error: Error launching source instance: AuthFailure: AWS was not able to validate the provided access credentials

│ status code: 401, request id: 5c1d07f2-d071-436e-ba78-c1ef4833feed

│ with aws_instance.test-servers,

│ on main.tf line 13, in resource “aws_instance” “test-servers”:

│ 13: resource “aws_instance” “test-servers” {

Hello @shishirtsahu,
Can you please share more details in which playground you are running this TF file? So that I can help you in a better way.

Regards,
KodeKloud Support

Hi Tej,

I am running the Tf file in the Terraform playground. The same thing doesn’t work in the terragrunt playground also.

Regards,
Shishir

and what do you want to do with that TF file? Are you creating an AWS instance from that TF file from our playground?

Regards,
KodeKloud Support

Im getting the same error in the Terragrunt playground.

Im just trying to terraform apply the code thats on there which creates aws instance.

root in ~/code/terraform-projects via 💠 default on ☁️  (us-east-1) 
❯ terraform apply
aws_instance.test-servers: Creating...
╷
│ Warning: AWS account ID not found for provider
│ 
│   with provider["registry.terraform.io/hashicorp/aws"],
│   on provider.tf line 1, in provider "aws":
│    1: provider "aws" {
│ 
│ See https://registry.terraform.io/providers/hashicorp/aws/latest/docs#skip_requesting_account_id for implications.
╵
╷
│ Error: creating EC2 Instance: AuthFailure: AWS was not able to validate the provided access credentials
│       status code: 401, request id: ce43d7dc-3fc4-4143-ba22-421f36b30a7f
│ 
│   with aws_instance.test-servers,
│   on main.tf line 13, in resource "aws_instance" "test-servers":
│   13: resource "aws_instance" "test-servers" {
│

The endpoint seem to be configured but the aws instance creation fails

❯ aws ec2 describe-instances --endpoint http://aws:4566
{
    "Reservations": []
}

Pls sort this out at the earliest

Thanks for highlighting this, @bhatganesh. The team is looking into this. Please provide us with some time.

Regards,

The team has fixed the issue. Please give it a try.