"Error: Unsupported Terraform Core version" when using the AWS installer image

Hello,

I am trying to use the self-hosted install on AWS steps provided here: https://www.gitpod.io/docs/self-hosted/latest/install/install-on-aws-script//

When I run Step 2, I get this error:

Initializing modules…

Error: Unsupported Terraform Core version

on .terraform/modules/kubernetes/versions.tf line 2, in terraform:
2: required_version = “>= 0.12.9, != 0.13.0”

Module module.kubernetes (from terraform-aws-modules/eks/aws) does not support
Terraform version 0.13.0. To proceed, either choose another supported
Terraform version or update this version constraint. Version constraints are
normally set for good reason, so updating the constraint may lead to other
errors or unexpected behavior.

!!
!! terraform failed: “exit status 1”
!!

Hey,
I was having the same problem. I installed a higher version of terraform (I think 13.6 or something) on my ec2 machine (amazon linux). After running the installer and getting the error, I did:
cd into the “aws” directory (i think its like awsinstaller->gitpod->aws or something)
sudo terraform init (which I believe deletes and re initializes the .terraform dir)
then cd back to ~
then ran the installer again with:
docker run --rm -it
-e AWS_ACCESS_KEY_ID
-e AWS_SECRET_ACCESS_KEY
-v “$PWD/awsinstall”:"/workspace"
eu.gcr.io/gitpod-io/self-hosted/installer:latest aws

The issue was answered here but it took me a while to figure it out exactly (because first time with docker/terraform/servers). So I hope this also fixes your problem. Let me know if you are still confused and I can explain more what I did :slight_smile:

I followed those steps. After running the command again I get the same error.

Initializing modules…

Error: Unsupported Terraform Core version

on .terraform/modules/kubernetes/versions.tf line 2, in terraform:
2: required_version = “>= 0.12.9, != 0.13.0”

Module module.kubernetes (from terraform-aws-modules/eks/aws) does not support
Terraform version 0.13.0. To proceed, either choose another supported
Terraform version or update this version constraint. Version constraints are
normally set for good reason, so updating the constraint may lead to other
errors or unexpected behavior.

!!
!! terraform failed: “exit status 1”
!!

Sorry I forgot to add that I removed the != 0.13.0 in the versions.tf
I know it says maybe not to, but I figure it’s installing the same version over the top of the same version. I didn’t have any problems with it anyways.
the part that confused me is that the .terraform directory is hidden (I know im noob). so just do
cd awsinstaller/gitpod/aws/.terraform/modules/kubernetes
sudo nano versions.tf
and edit it to “>= 0.12.9”

Let me know if it works!

ahhh thanks! I will try that now.

The issue has been fixed yesterday. https://github.com/gitpod-io/gitpod/pull/2075/files
The problem has been the build image dev-environment that had still the terraform v0.13.0 in it. This has been updated.

2 Likes

Still Have the same issue.
Snip20201118_1

But still facing the issue while running i aws ec2 centos.

docker run --rm -it
-e AWS_ACCESS_KEY_ID
-e AWS_SECRET_ACCESS_KEY
-v “$PWD/awsinstall”:"/workspace"
eu.gcr.io/gitpod-io/self-hosted/installer:latest aws

1 Like