Skip to content

Commit

Permalink
Adding IPv6 support to vpc-peering
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelrn committed Sep 12, 2024
1 parent bbd9e72 commit fe42da5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/vpc-peering/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ No modules.
| <a name="input_peer_import_subnet_routes_with_public_ip"></a> [peer\_import\_subnet\_routes\_with\_public\_ip](#input\_peer\_import\_subnet\_routes\_with\_public\_ip) | Import subnet routes with public IP setting for 'peer->local' direction. | `bool` | `false` | no |
| <a name="input_peer_network"></a> [peer\_network](#input\_peer\_network) | Self-link or id of the second network (peer) in pair. | `string` | n/a | yes |
| <a name="input_peer_peering_name"></a> [peer\_peering\_name](#input\_peer\_peering\_name) | Name for 'peer->local' direction peering resource. If not specified defaults to `<name_prefix><peer network name>-<local network name>`. | `string` | `null` | no |
| <a name="input_stack_type"></a> [stack\_type](#input\_stack\_type) | Which IP version(s) or routes are allowed to be imported or exported between peer networks. Possible values: `IPV4_ONLY` (default), `IPV4_IPV6`. | `string` | `null` | no |

### Outputs

Expand Down
2 changes: 2 additions & 0 deletions modules/vpc-peering/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ resource "google_compute_network_peering" "local" {

export_subnet_routes_with_public_ip = var.local_export_subnet_routes_with_public_ip
import_subnet_routes_with_public_ip = var.local_import_subnet_routes_with_public_ip
stack_type = var.stack_type
}

resource "google_compute_network_peering" "peer" {
Expand All @@ -25,4 +26,5 @@ resource "google_compute_network_peering" "peer" {

export_subnet_routes_with_public_ip = var.peer_export_subnet_routes_with_public_ip
import_subnet_routes_with_public_ip = var.peer_import_subnet_routes_with_public_ip
stack_type = var.stack_type
}
6 changes: 6 additions & 0 deletions modules/vpc-peering/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ variable "name_prefix" {
type = string
}

variable "stack_type" {
description = "Which IP version(s) or routes are allowed to be imported or exported between peer networks. Possible values: `IPV4_ONLY` (default), `IPV4_IPV6`."
default = null
type = string
}

variable "local_export_custom_routes" {
description = "Export custom routes setting for 'local->peer' direction."
default = false
Expand Down

0 comments on commit fe42da5

Please sign in to comment.