Terrafrom 0.13 upgrade + terrafrom init issue on MacOS

Need help in resolving this please for google cloud as the provider

bin xxx$ terraform 0.13upgrade

Error: Not a module directory

The given directory . does not contain any Terraform configuration files.

xxx$ terraform 0.13upgrade

Error: Not a module directory

The given directory . does not contain any Terraform configuration files.

:iac xxx terraform init
Terraform initialized in an empty directory!

The directory has no Terraform configuration files. You may begin working
with Terraform immediately by creating Terraform configuration files.

iac xxx$ terraform version
Terraform v0.13.5

Hi @MiloSolo,

Does your current working directory contain any files with the suffix .tf or the suffix .tf.json? If not, was there a different directory you were intending to upgrade?

@apparentlymart my directly have both a .tf and .json files. my current terraform version is v0.13.5.

Below are my initial configuration on the main.tf

terraform {
required_providers {
google = {
source = “hashicorp/google”
version = “3.45.0”
}
}
}

provider “google” {
project = var.gcp_project
credentials = var.gcp_xxx
region = var.gcp_region
}

Found the issue. Looks like it want me to be in the directory where I have the terraform provider and not the root of the directory

1 Like