-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IPsec-encrypted Interconnect (#4777)
* IPsec over interconnect feature * Removing test from other branch * Mark several encryption fields as input-only
- Loading branch information
Showing
6 changed files
with
280 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
mmv1/templates/terraform/examples/compute_address_ipsec_interconnect.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
resource "google_compute_address" "<%= ctx[:primary_resource_id] %>" { | ||
name = "<%= ctx[:vars]['address_name'] %>" | ||
address_type = "INTERNAL" | ||
purpose = "IPSEC_INTERCONNECT" | ||
address = "192.168.1.0" | ||
prefix_length = 29 | ||
network = google_compute_network.network.self_link | ||
provider = google-beta | ||
} | ||
|
||
resource "google_compute_network" "network" { | ||
name = "<%= ctx[:vars]['network_name'] %>" | ||
auto_create_subnetworks = false | ||
provider = google-beta | ||
} |
73 changes: 73 additions & 0 deletions
73
mmv1/templates/terraform/examples/compute_ha_vpn_gateway_encrypted_interconnect.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
resource "google_compute_ha_vpn_gateway" "<%= ctx[:primary_resource_id] %>" { | ||
name = "<%= ctx[:vars]['ha_vpn_gateway_name'] %>" | ||
network = google_compute_network.network.id | ||
vpn_interfaces { | ||
id = 0 | ||
interconnect_attachment = google_compute_interconnect_attachment.attachment1.self_link | ||
} | ||
vpn_interfaces { | ||
id = 1 | ||
interconnect_attachment = google_compute_interconnect_attachment.attachment2.self_link | ||
} | ||
provider = google-beta | ||
} | ||
|
||
resource "google_compute_interconnect_attachment" "attachment1" { | ||
name = "<%= ctx[:vars]['interconnect_attachment1_name'] %>" | ||
edge_availability_domain = "AVAILABILITY_DOMAIN_1" | ||
type = "PARTNER" | ||
router = google_compute_router.router.id | ||
encryption = "IPSEC" | ||
ipsec_internal_addresses = [ | ||
google_compute_address.address1.self_link, | ||
] | ||
provider = google-beta | ||
} | ||
|
||
resource "google_compute_interconnect_attachment" "attachment2" { | ||
name = "<%= ctx[:vars]['interconnect_attachment2_name'] %>" | ||
edge_availability_domain = "AVAILABILITY_DOMAIN_2" | ||
type = "PARTNER" | ||
router = google_compute_router.router.id | ||
encryption = "IPSEC" | ||
ipsec_internal_addresses = [ | ||
google_compute_address.address2.self_link, | ||
] | ||
provider = google-beta | ||
} | ||
|
||
resource "google_compute_address" "address1" { | ||
name = "<%= ctx[:vars]['address1_name'] %>" | ||
address_type = "INTERNAL" | ||
purpose = "IPSEC_INTERCONNECT" | ||
address = "192.168.1.0" | ||
prefix_length = 29 | ||
network = google_compute_network.network.self_link | ||
provider = google-beta | ||
} | ||
|
||
resource "google_compute_address" "address2" { | ||
name = "<%= ctx[:vars]['address2_name'] %>" | ||
address_type = "INTERNAL" | ||
purpose = "IPSEC_INTERCONNECT" | ||
address = "192.168.2.0" | ||
prefix_length = 29 | ||
network = google_compute_network.network.self_link | ||
provider = google-beta | ||
} | ||
|
||
resource "google_compute_router" "router" { | ||
name = "<%= ctx[:vars]['router_name'] %>" | ||
network = google_compute_network.network.name | ||
encrypted_interconnect_router = true | ||
bgp { | ||
asn = 16550 | ||
} | ||
provider = google-beta | ||
} | ||
|
||
resource "google_compute_network" "network" { | ||
name = "<%= ctx[:vars]['network_name'] %>" | ||
auto_create_subnetworks = false | ||
provider = google-beta | ||
} |
37 changes: 37 additions & 0 deletions
37
mmv1/templates/terraform/examples/compute_interconnect_attachment_ipsec_encryption.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
resource "google_compute_interconnect_attachment" "<%= ctx[:primary_resource_id] %>" { | ||
name = "<%= ctx[:vars]['interconnect_attachment_name'] %>" | ||
edge_availability_domain = "AVAILABILITY_DOMAIN_1" | ||
type = "PARTNER" | ||
router = google_compute_router.router.id | ||
encryption = "IPSEC" | ||
ipsec_internal_addresses = [ | ||
google_compute_address.address.self_link, | ||
] | ||
provider = google-beta | ||
} | ||
|
||
resource "google_compute_address" "address" { | ||
name = "<%= ctx[:vars]['address_name'] %>" | ||
address_type = "INTERNAL" | ||
purpose = "IPSEC_INTERCONNECT" | ||
address = "192.168.1.0" | ||
prefix_length = 29 | ||
network = google_compute_network.network.self_link | ||
provider = google-beta | ||
} | ||
|
||
resource "google_compute_router" "router" { | ||
name = "<%= ctx[:vars]['router_name'] %>" | ||
network = google_compute_network.network.name | ||
encrypted_interconnect_router = true | ||
bgp { | ||
asn = 16550 | ||
} | ||
provider = google-beta | ||
} | ||
|
||
resource "google_compute_network" "network" { | ||
name = "<%= ctx[:vars]['network_name'] %>" | ||
auto_create_subnetworks = false | ||
provider = google-beta | ||
} |
15 changes: 15 additions & 0 deletions
15
mmv1/templates/terraform/examples/compute_router_encrypted_interconnect.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
resource "google_compute_router" "<%= ctx[:primary_resource_id] %>" { | ||
name = "<%= ctx[:vars]['router_name'] %>" | ||
network = google_compute_network.network.name | ||
encrypted_interconnect_router = true | ||
bgp { | ||
asn = 64514 | ||
} | ||
provider = google-beta | ||
} | ||
|
||
resource "google_compute_network" "network" { | ||
name = "<%= ctx[:vars]['network_name'] %>" | ||
auto_create_subnetworks = false | ||
provider = google-beta | ||
} |