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

Error creating subnets secondary_ip with module net-vpc #1197

Closed
mcolladoacciona opened this issue Feb 28, 2023 · 2 comments · Fixed by #1198
Closed

Error creating subnets secondary_ip with module net-vpc #1197

mcolladoacciona opened this issue Feb 28, 2023 · 2 comments · Fixed by #1198

Comments

@mcolladoacciona
Copy link

Modules version: 20.0.0
Module: net-vpc

When trying to create a VPC with subnet and secondary_ip_rangethe module never creates the secondary IP's. We try a lot of combinations inside de secondary_ip_range{} but never creates the resources.

module "lz_host_network" {
  source     = "github.com/GoogleCloudPlatform/cloud-foundation-fabric//modules/net-vpc?ref=v20.0.0"
  project_id = var.project
  name       = var.vpc_name
  subnets = [
    {
      ip_cidr_range = var.subnet_range
      name          = var.subnet_name
      region        = var.region
      secondary_ip_range = {
        pods     = "172.16.0.0/20"
        services = "192.168.30.0/24"
      }
    }
  ]
  subnets_psc = [
    {
      ip_cidr_range = var.psc_subnet_range
      name          = var.psc_name
      region        = var.region
    }
  ]
  shared_vpc_host = true
  shared_vpc_service_projects = [
    local.service_project_core_services.project_id,
    local.service_project_monitoring.project_id,
    local.service_project_datalake.project_id
  ]
  subnet_iam = {
    "europe-west1/prod-acc-gcp-lz-sbn-01" = {
      "roles/compute.networkUser" = [
        local.service_project_core_services.gke_service_account
      ]
      "roles/compute.securityAdmin" = [
        local.service_project_core_services.gke_service_account
      ]
    }
  }
}

We're missing any variable or configuration to be present on the module to execute and create the resources?

Regards

@juliocc
Copy link
Collaborator

juliocc commented Feb 28, 2023

You're missing an s in secondary_ip_range. It should read secondary_ip_ranges.

Did you copy this from the documentation? if so we should update it.

@mcolladoacciona
Copy link
Author

Thanks @juliocc was that missing S!! To be honest I copy paste so many times that I don't know where I missed the S hehe.

Ok, searching online I found the error on the net-vpc README.md README On the Shared VPC example, the secondary_ip_range has a missing S.

ludoo added a commit that referenced this issue Feb 28, 2023
ludoo added a commit that referenced this issue Mar 1, 2023
juliocc added a commit that referenced this issue Mar 1, 2023
juliocc added a commit that referenced this issue Mar 1, 2023
simonebruzzechesse pushed a commit that referenced this issue Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants