Error: configuring Terraform AWS Provider: no valid credential sources for Terraform AWS Provider found

Here is the full error:
Please see Terraform Registry
│ for more information about providing credentials.

│ AWS Error: failed to refresh cached credentials, no EC2 IMDS role found, operation error ec2imds: GetMetadata, request canceled, context deadline exceeded

│ with provider[“Terraform Registry”],
│ on line 19, in provider “aws”:
│ 19: provider “aws” {

 backend "remote" {
 organization = "13xxxx"
 workspaces {
   name = "Example-Workspace"
 required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 4.16"

  required_version = ">= 1.2.0"

provider "aws" {
  region  = "us-west-2"

resource "aws_instance" "app_server" {
  ami           = "ami-08d70e59c07c61a3a"
  instance_type = "t2.micro"

Seems like it could be related to Required Additional Configuration When Using IMDSv2 – HashiCorp Help Center

Care to add more information about how the EC2 instance was setup and if you can access the IMDSv2 service from it?

I simply followed the 8 video AWS tutorial on Terrafon at the Terraform site, and this failure occurred on the 8th video where we are shown how to migrate the local files to Terraform Cloud. The code I pasted here came directly from the instructions provided by Terraform. I hope this helps.

I failed to notice this sentence before. Check out Authentication and Configuration of the Terraform Provider

If you’re referring to this video, at 03:50, you can see how the access key id and secret are configured.

Store Remote State | Terraform | HashiCorp Developer