Skip to content

Commit 9e83dc2

Browse files
authored
Add group field to google_network_connectivity_spoke (#12537)
1 parent 3b3cb68 commit 9e83dc2

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

mmv1/products/networkconnectivity/Spoke.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ examples:
4444
network_name: 'net'
4545
hub_name: 'hub1'
4646
spoke_name: 'spoke1'
47+
- name: 'network_connectivity_spoke_linked_vpc_network_group'
48+
primary_resource_id: 'primary'
49+
vars:
50+
network_name: 'net-spoke'
51+
hub_name: 'hub1-spoke'
52+
spoke_name: 'group-spoke1'
4753
- name: 'network_connectivity_spoke_router_appliance_basic'
4854
primary_resource_id: 'primary'
4955
vars:
@@ -122,6 +128,11 @@ properties:
122128
immutable: true
123129
resource: 'hub'
124130
imports: 'name'
131+
- name: 'group'
132+
type: String
133+
description: The name of the group that this spoke is associated with.
134+
immutable: true
135+
default_from_api: true
125136
- name: 'linkedVpnTunnels'
126137
type: NestedObject
127138
description: The URIs of linked VPN tunnel resources
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
resource "google_compute_network" "network" {
2+
name = "{{index $.Vars "network_name"}}"
3+
auto_create_subnetworks = false
4+
}
5+
6+
resource "google_network_connectivity_hub" "basic_hub" {
7+
name = "{{index $.Vars "hub_name"}}"
8+
description = "A sample hub"
9+
labels = {
10+
label-two = "value-one"
11+
}
12+
}
13+
14+
resource "google_network_connectivity_group" "default_group" {
15+
hub = google_network_connectivity_hub.basic_hub.id
16+
name = "default"
17+
description = "A sample hub group"
18+
}
19+
20+
resource "google_network_connectivity_spoke" "{{$.PrimaryResourceId}}" {
21+
name = "{{index $.Vars "spoke_name"}}"
22+
location = "global"
23+
description = "A sample spoke with a linked VPC"
24+
labels = {
25+
label-one = "value-one"
26+
}
27+
hub = google_network_connectivity_hub.basic_hub.id
28+
linked_vpc_network {
29+
exclude_export_ranges = [
30+
"198.51.100.0/24",
31+
"10.10.0.0/16"
32+
]
33+
include_export_ranges = [
34+
"198.51.100.0/23",
35+
"10.0.0.0/8"
36+
]
37+
uri = google_compute_network.network.self_link
38+
}
39+
group = google_network_connectivity_group.default_group.id
40+
}

0 commit comments

Comments
 (0)