Co-authored-by: Luca Prete <lucaprete@google.com> |
||
---|---|---|
.. | ||
README.md | ||
main.tf | ||
outputs.tf | ||
variables.tf | ||
versions.tf |
README.md
Google Network Peering
This module allows creation of a VPC Network Peering between two networks.
The resources created/managed by this module are:
- one network peering from
local network
topeer network
- one network peering from
peer network
tolocal network
Usage
Basic usage of this module is as follows:
module "peering" {
source = "modules/net-vpc-peering"
prefix = "name-prefix"
local_network = "<FIRST NETWORK SELF LINK>"
peer_network = "<SECOND NETWORK SELF LINK>"
}
If you need to create more than one peering for the same VPC Network (A -> B, A -> C)
you have to use output from the first module as a dependency for the second one to keep order of peering creation (It is not currently possible to create more than one peering connection for a VPC Network at the same time).
module "peering-a-b" {
source = "modules/net-vpc-peering"
prefix = "name-prefix"
local_network = "<A NETWORK SELF LINK>"
peer_network = "<B NETWORK SELF LINK>"
}
module "peering-a-c" {
source = "modules/net-vpc-peering"
prefix = "name-prefix"
local_network = "<A NETWORK SELF LINK>"
peer_network = "<C NETWORK SELF LINK>"
module_depends_on = [module.peering-a-b.complete]
}
Variables
name | description | type | required | default |
---|---|---|---|---|
local_network | Resource link of the network to add a peering to. | string |
✓ | |
peer_network | Resource link of the peer network. | string |
✓ | |
export_local_custom_routes | Export custom routes to peer network from local network. | bool |
false |
|
export_peer_custom_routes | Export custom routes to local network from peer network. | bool |
false |
|
module_depends_on | List of modules or resources this module depends on. | list |
[] |
|
prefix | Name prefix for the network peerings | string |
network-peering |
Outputs
name | description | sensitive |
---|---|---|
complete | Output to be used as a module dependency. | |
local_network_peering | Network peering resource. | |
peer_network_peering | Peer network peering resource. |