I'm following this documentation in migrating the local state to be integrated with Terraform Cloud.
https://learn.hashicorp.com/tutorials/terraform/cloud-migrate
It is fairly straightforward, I just need to copy this code:
terraform {
required_version = ">= 1.1.0"
required_providers {
random = {
source = "hashicorp/random"
version = "3.0.1"
}
}
cloud {
organization = "<ORG_NAME>"
workspaces {
name = "Example-Workspace"
}
}
}
The problem is that my code below has the same code with above
terraform {
required_version = ">= 0.14.9"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.27"
}
}
cloud {
organization = "ORG"
workspaces {
name = "ORG_WORKSPACE"
}
}
}
But it is returning an error:
Blocks of type "cloud" are not expected here.
Some notes:
providers.tf
.terraform apply
, thus returning tfstate.terraform login
with my credentials.Any help would be much appreciated. Thank you!
cloud
is only supported in TF 1.1.0, not any older version. From docs:
Because the cloud block is not supported by older versions of Terraform, you must use 1.1.0 or higher in order to follow this tutorial.
You have to upgrade your TF 0.14 to the newest version.