Getting 'Incompatible provider error' initializing terraform

Hi there!

I am constantly getting this error while trying to initialize terraform in 2nd week lab. Any ideas how can I work over it?

Thanks in advance. :smile:

@kmjablonka The solution I found for this problem is to create a file called main.tf and add the following entries

terraform {
required_providers {
aws = {
source = “hashicorp/aws”
version = “~> 4.16”
}
}

required_version = “>= 1.2.0”
}

provider “aws” {
region = “us-east-1”
}

After making this change it worked for me. Please don’t forget to save the file main.tf

1 Like

Hello @kmjablonka and @shanilr nice workaround, I could reproduce the issue and got the same error. I simply deleted that environment and created a new one and the problem seems to be resolved. Could you try again in a new environment, thank you

Getting back to the assignment after an hour or two just simply resolved the issue.