"No valid credential sources found"

The terraform plan command is giving the following error in the kodekloud lab
➜ terraform plan

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

╷
│ Error: No valid credential sources found
│ 
│   with provider["registry.terraform.io/hashicorp/aws"],
│   on provider.tf line 1, in provider "aws":
│    1: provider "aws" {
│ 
│ Please see https://registry.terraform.io/providers/hashicorp/aws
│ for more information about providing credentials.
│ 
│ Error: failed to refresh cached credentials, no EC2 IMDS role found, operation error ec2imds: GetMetadata,
│ request canceled, context deadline exceeded

Kindly help

This most likely is a lack of needed permissions. Where are you seeing this? In a lab (in which case, we’d need to know the link to the lab), a playground, or somewhere else?