terraform-google-modules/terraform-google-address

Is it possible to get self-link of created addresses?

thecodejunkie opened this issue · 2 comments

Hi

Is there a way to get the self-links of created IP addresses? A scenario I am facing is when setting up a new Cloud NAT and it needs the nat_ips passed in, whihc should be an array of self-links.

module "ip" {
  source  = "terraform-google-modules/address/google"
  version = "2.0.0"

  names  = [var.name]
  global = true
  region  = var.region
  project_id = var.project_id
}

resource "google_compute_router" "router" {
  name = "${var.name}-nat-router"
  network = module.vpc.network_self_link
}

module "cloud-nat" {
  source     = "terraform-google-modules/cloud-nat/google"
  version    = "1.2.0"
  project_id = var.project_id
  region     = var.region

  nat_ips    = module.ip.?????
  router     = google_compute_router.router.name
}

It doesn't look like we currently output them, but we could add easily.

@morgante, PR is merged now, could you make a new release having this feature?