Skip to content
This repository was archived by the owner on Dec 10, 2021. It is now read-only.

Add support for Shared VPCs #39

@jackmurphy

Description

@jackmurphy

I'm getting the following errors when I specify IP addresses while utilizing shared VPCs.

* google_compute_firewall.mig-health-check: Error creating firewall: googleapi: Error 404: The resource 'projects/ecomm-browse-staging/global/networks/vpc-staging' was not found, notFound
* module.us-west1-a-egress.module.nat-gateway.var.access_config: Resource 'data.google_compute_address.default' not found for variable 'data.google_compute_address.default.address'
* module.us-west1-b-egress.output.external_ip: Resource 'data.google_compute_address.default' not found for variable 'data.google_compute_address.default.address'

There's a number of things going on. While I'm able to specify which project the google_compute_network lives in by passing the network_project variable, this causes issues since it's also being passed to the google_compute_address data resource. I don't believe this should be the case since the documentation states:

External IP addresses defined in the host project are only usable by resources in that project. They are not available for use in service projects. Service projects can maintain their own set of external IP addresses.

Unfortunately that's not the only complication. The nat-gateway module is hardcoded to look for it's google_compute_network resources in var.project not var.network_project.

In order to really support shared VPCs we'll have to make some changes upstream as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions