The code on your tutorial page for GCP seems wrong. This is taken from the following guide:
https://learn.hashicorp.com/tutorials/terraform/google-cloud-platform-build?in=terraform/gcp-get-started
This is the code that is on the page:
terraform {
required_providers {
google = {
source = "hashicorp/google"
version = "3.5.0"
}
}
}
provider "google" {
credentials = file("<NAME>.json")
project = "<PROJECT_ID>"
region = "us-central1"
zone = "us-central1-c"
}
resource "google_compute_network" "vpc_network" {
name = "terraform-network"
}
And whether I do terraform plan
or terraform apply
I get the following error:
Error: Invalid version constraint
on main.tf line 3, in terraform:
3: google = {
4: source = "hashicorp/google"
5: version = "3.5.0"
6: }
A string value is required for google.