terraform-google-modules / terraform-example-foundation

Shows how the CFT modules can be composed to build a secure cloud foundation
https://cloud.google.com/architecture/security-foundations
Apache License 2.0
1.23k stars 720 forks source link

Unsupported Terraform Core version #226

Closed packetdiscards closed 2 years ago

packetdiscards commented 4 years ago

Default version on hashicorp website is 0.13.0, therefore users who are following the readme and proceed to download 0.13.0 will receive the following errors:

Error: Unsupported Terraform Core version

  on versions.tf line 18, in terraform:
  18:   required_version = "~> 0.12.6"

This configuration 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.
packetdiscards commented 4 years ago

To workaround this issue, need to install terraform 0.12.x (e.g. Terraform v0.12.29)

bharathkkb commented 4 years ago

Agreed and I think rather than updating the readme, we should use this opportunity to relax version constraints across the different CFT modules used to ensure 0.12 and 0.13 compat.

morgante commented 4 years ago

While we can incrementally relax version constraints, we don't need to recommend Terraform 0.13 yet.

bharathkkb commented 3 years ago

While v2 will officially support and test for 0.13, we should update constraints to >=0.13 to enable users who wish to deploy with 0.14+. Example version that needs update: https://github.com/terraform-google-modules/terraform-example-foundation/blob/d1122dd370b806e6533914320cd6a96df275b7d9/0-bootstrap/versions.tf#L18

devanand73 commented 3 years ago

why "terraform console" not supported in version 1.0.0 Error: Unsupported Terraform Core version │ │ on c1-versions.tf line 3, in terraform: │ 3: required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx │ │ This configuration does not support Terraform version 1.0.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.

bharathkkb commented 2 years ago

This should be fixed now

rubiagatra commented 2 years ago

still happening to me

 Error: Unsupported Terraform Core version
│
│   on .terraform/modules/network/versions.tf line 18, in terraform:
│   18:   required_version = "~> 0.12.6"
│
│ Module module.network (from terraform-google-modules/network/google) does not support Terraform version 1.0.11. 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.
╵
bharathkkb commented 2 years ago

@rubiagatra are you using the a post v2 release/main branch?

rubiagatra commented 2 years ago

sorry @bharathkkb my bad, I just followed the Linux academy course it used 1.1.0.

and then I used ~> 3.0 it works! thank you https://registry.terraform.io/modules/terraform-google-modules/network/google/latest

sathish-git123 commented 2 years ago

hi iam getting this error while i was provisioning aws vpc resource, can anyone help me with this?

thanks in advance er-Block/terraform-manifests (main) $ terraform init ╷ │ Error: Unsupported Terraform Core version │ │ on c1-versions.tf line 3, in terraform: │ 3: required_version = "~> 0.14.6" │ │ This configuration does not support Terraform version 1.1.2. 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.

sathish-git123 commented 2 years ago

Terraform Block

terraform { required_version = "~> 0.14.6" required_providers { aws = { source = "hashicorp/aws" version = "~> 3.0" } } }

Provider Block

provider "aws" { region = "us-east-1" profile = "default" }

vpc-resource block

Resource Block

Resource-1: Create VPC

resource "aws_vpc" "myvpc" { cidr_block = "10.0.0.0/16" tags = { "Name" = "myvpc" } }

RickyDev0p commented 2 years ago

why "terraform console" not supported in version 1.0.0 Error: Unsupported Terraform Core version │ │ on c1-versions.tf line 3, in terraform: │ 3: required_version = "~> 0.14" # which means any version equal & above 0.14 like 0.15, 0.16 etc and < 1.xx │ │ This configuration does not support Terraform version 1.0.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.

I am getting same error with version 1.2.8 ? can anone please guide ?