0

I have a subnetwork module that I call from in my main.tf.

resource "google_compute_subnetwork" "vpc_sub_network" {

for_each = var.subnet_info
ip_cidr_range = each.value["subnet_ip_range"]
name = each.value["subnet_name"]
network = each.value["vpc_name"]
region = each.value["region"]
purpose = "INTERNAL_HTTPS_LOAD_BALANCER" --> unable to mention
role = "ACTIVE" --> unable to mention
}

I have checked in the documentations of terraform that we can mention Purpose and role when we create a subnetwork

in my main.tf

Provider "google"{
creds.....
}
module "vpc_sub_network" {
source = "./modular_approach/modules/general_network/"
}

Error

 on modular_approach\modules\general_network\main.tf line 5, in resource "google_compute_subnetwork" 
 "vpc_sub_network":
        5:   role = "ACTIVE"

 An argument named "role" is not expected here.
dumb_coder
  • 315
  • 5
  • 21
  • 1
    Shouldn't `Purpose` and `role` start with a small letter? – Marcin Aug 07 '20 at 10:35
  • 1
    Reading the Terraform docs for GCP provider, I can see two things: 1. both `purpose` and `role` are in *beta* and 2. I really hope that both options are lowercase in your config. – Marko E Aug 07 '20 at 10:36
  • actually both of them are in lower case still not working – dumb_coder Aug 07 '20 at 10:56
  • Then it probably depends on the version of the GCP provider you are using. Here's the documentation: https://www.terraform.io/docs/providers/google/guides/provider_versions.html. – Marko E Aug 07 '20 at 11:08

0 Answers0