-
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.
add examples and config for NCC star topology
- Loading branch information
1 parent
2936c3b
commit a1ae620
Showing
5 changed files
with
80 additions
and
0 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
7 changes: 7 additions & 0 deletions
7
mmv1/templates/terraform/examples/network_connectivity_hub_mesh_topology.tf.tmpl
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,7 @@ | ||
resource "google_network_connectivity_hub" "{{$.PrimaryResourceId}}" { | ||
name = "{{index $.Vars "resource_name"}}" | ||
description = "A sample mesh hub" | ||
labels = { | ||
label-one = "value-one" | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
mmv1/templates/terraform/examples/network_connectivity_hub_star_topology.tf.tmpl
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,9 @@ | ||
resource "google_network_connectivity_hub" "{{$.PrimaryResourceId}}" { | ||
name = "{{index $.Vars "resource_name"}}" | ||
description = "A sample star hub" | ||
labels = { | ||
label-one = "value-one" | ||
} | ||
preset_topology = "STAR" | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
mmv1/templates/terraform/examples/network_connectivity_spoke_center_group.tf.tmpl
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,35 @@ | ||
resource "google_compute_network" "network" { | ||
name = "tf-net" | ||
auto_create_subnetworks = false | ||
} | ||
|
||
resource "google_network_connectivity_hub" "star_hub" { | ||
name = "{{index $.Vars "hub_name"}}" | ||
preset_topology = "STAR" | ||
} | ||
|
||
resource "google_network_connectivity_group" "center_group" { | ||
name = "center" # (default , center , edge) | ||
hub = google_network_connectivity_hub.star_hub.id | ||
auto_accept { | ||
auto_accept_projects = [ | ||
"foo%{random_suffix}", | ||
"bar%{random_suffix}", | ||
] | ||
} | ||
} | ||
|
||
resource "google_network_connectivity_spoke" "primary" { | ||
name = "{{index $.Vars "spoke_name"}}" | ||
location = "global" | ||
description = "A sample spoke" | ||
labels = { | ||
label-one = "value-one" | ||
} | ||
hub = google_network_connectivity_hub.star_hub.id | ||
group = google_network_connectivity_group.center_group.id | ||
|
||
linked_vpc_network { | ||
uri = google_compute_network.network.self_link | ||
} | ||
} |