Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a network with no secondary ranges fails #5

Closed
morgante opened this issue Aug 29, 2018 · 2 comments · Fixed by #19
Closed

Creating a network with no secondary ranges fails #5

morgante opened this issue Aug 29, 2018 · 2 comments · Fixed by #19
Assignees

Comments

@morgante
Copy link
Contributor

The output expects at least one subnet to have a secondary range.

Config:

module "network2" {
  source       = "../../modules/network"
  project_id   = "${data.terraform_remote_state.projects.net-host-project-id}"
  network_name = "sandbox-vpc2"
  shared_vpc_host = "true"

  subnets = [
    {
      subnet_name           = "sandbox-compute"
      subnet_ip             = "10.18.0.0/20"
      subnet_region         = "us-central1"
      subnet_private_access = false
    },
  ]

  secondary_ranges = {
    sandbox-compute = []
  }
}

Error:

Error: Error running plan: 1 error(s) occurred:

* module.network2.output.subnets_secondary_ranges: Resource 'google_compute_subnetwork.subnetwork' does not have attribute 'secondary_ip_range' for variable 'google_compute_subnetwork.subnetwork.*.secondary_ip_range'
@rubencode
Copy link

rubencode commented Oct 19, 2018

I believe this could be failing due to the output.tf in the root module folder:
output "subnets_secondary_ranges" {
value = "${google_compute_subnetwork.subnetwork.*.secondary_ip_range}"
description = "The secondary ranges associated with these subnets"
}

@angstwad
Copy link
Contributor

angstwad added a commit to angstwad/terraform-google-network that referenced this issue Nov 29, 2018
morgante added a commit that referenced this issue Jan 10, 2019
Adds subnet data source, allows no secondary range in subnets; fixes #5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants