Skip to main content

VPC peering

The module allows to create VPC peering between two networks in both directions.

By default, no routes are exported/imported for each direction, every option has to be explicitely enabled by setting appropriate value to true.

GitHub Logo Terraform Logo

Reference

Requirements

NameVersion
terraform>= 1.3, < 2.0

Providers

NameVersion
googlen/a

Modules

No modules.

Resources

NameType
google_compute_network_peering.localresource
google_compute_network_peering.peerresource

Inputs

NameDescriptionTypeDefaultRequired
local_export_custom_routesExport custom routes setting for 'local->peer' direction.boolfalseno
local_export_subnet_routes_with_public_ipExport subnet routes with public IP setting for 'local->peer' direction.boolfalseno
local_import_custom_routesImport custom routes setting for 'local->peer' direction.boolfalseno
local_import_subnet_routes_with_public_ipImport subnet routes with public IP setting for 'local->peer' direction.boolfalseno
local_networkSelf-link or id of the first network (local) in pair.stringn/ayes
local_peering_nameName for 'local->peer' direction peering resource. If not specified defaults to <name_prefix><local network name>-<peer network name>.stringnullno
name_prefixOptional prefix for auto-generated peering resource names.string""no
peer_export_custom_routesExport custom routes setting for 'peer->local' direction.boolfalseno
peer_export_subnet_routes_with_public_ipExport subnet routes with public IP setting for 'peer->local' direction.boolfalseno
peer_import_custom_routesImport custom routes setting for 'peer->local' direction.boolfalseno
peer_import_subnet_routes_with_public_ipImport subnet routes with public IP setting for 'peer->local' direction.boolfalseno
peer_networkSelf-link or id of the second network (peer) in pair.stringn/ayes
peer_peering_nameName for 'peer->local' direction peering resource. If not specified defaults to <name_prefix><peer network name>-<local network name>.stringnullno

Outputs

No outputs.