Skip to content

Commit 3957d88

Browse files
add GW spoke
1 parent 4274132 commit 3957d88

File tree

4 files changed

+90
-0
lines changed

4 files changed

+90
-0
lines changed

mmv1/products/networkconnectivity/Hub.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ properties:
112112
enum_values:
113113
- 'MESH'
114114
- 'STAR'
115+
- 'HYBRID_INSPECTION'
115116
default_from_api: true
116117
- name: 'policyMode'
117118
type: Enum

mmv1/products/networkconnectivity/Spoke.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,13 @@ examples:
110110
network_name: 'net'
111111
hub_name: 'hub1'
112112
spoke_name: 'spoke1-ipv6'
113+
- name: 'network_connectivity_spoke_gateway'
114+
primary_resource_id: 'primary'
115+
min_version: beta
116+
vars:
117+
network_name: 'net-spoke'
118+
hub_name: 'hub'
119+
spoke_name: 'gateway'
113120
parameters:
114121
- name: 'location'
115122
type: String
@@ -148,6 +155,7 @@ properties:
148155
- name: 'group'
149156
type: String
150157
description: The name of the group that this spoke is associated with.
158+
diff_suppress_func: 'tpgresource.CompareSelfLinkOrResourceName'
151159
immutable: true
152160
default_from_api: true
153161
- name: 'linkedVpnTunnels'
@@ -158,6 +166,7 @@ properties:
158166
- linked_router_appliance_instances
159167
- linked_vpc_network
160168
- linked_producer_vpc_network
169+
- gateway
161170
update_mask_fields:
162171
- 'linkedVpnTunnels.includeImportRanges'
163172
properties:
@@ -188,6 +197,7 @@ properties:
188197
- linked_router_appliance_instances
189198
- linked_vpc_network
190199
- linked_producer_vpc_network
200+
- gateway
191201
update_mask_fields:
192202
- 'linkedInterconnectAttachments.includeImportRanges'
193203
properties:
@@ -218,6 +228,7 @@ properties:
218228
- linked_vpn_tunnels
219229
- linked_vpc_network
220230
- linked_producer_vpc_network
231+
- gateway
221232
update_mask_fields:
222233
- 'linkedRouterApplianceInstances.instances'
223234
- 'linkedRouterApplianceInstances.includeImportRanges'
@@ -259,6 +270,7 @@ properties:
259270
- linked_router_appliance_instances
260271
- linked_vpn_tunnels
261272
- linked_producer_vpc_network
273+
- gateway
262274
update_mask_fields:
263275
- 'linkedVpcNetwork.excludeExportRanges'
264276
- 'linkedVpcNetwork.includeExportRanges'
@@ -288,6 +300,7 @@ properties:
288300
- linked_router_appliance_instances
289301
- linked_vpn_tunnels
290302
- linked_vpc_network
303+
- gateway
291304
properties:
292305
- name: network
293306
type: String
@@ -315,6 +328,39 @@ properties:
315328
description: IP ranges encompassing the subnets to be excluded from peering.
316329
item_type:
317330
type: String
331+
- name: gateway
332+
type: NestedObject
333+
description: Todo
334+
immutable: true
335+
min_version: beta
336+
conflicts:
337+
- linked_interconnect_attachments
338+
- linked_router_appliance_instances
339+
- linked_vpn_tunnels
340+
- linked_vpc_network
341+
- linkedProducerVpcNetwork
342+
properties:
343+
- name: ipRangeReservations
344+
type: Array
345+
description: Todo
346+
required: true
347+
immutable: false
348+
item_type:
349+
type: NestedObject
350+
properties:
351+
- name: ipRange
352+
type: String
353+
description: Todo
354+
required: true
355+
- name: capacity
356+
type: Enum
357+
description: todo
358+
immutable: false
359+
required: false
360+
enum_values:
361+
- 'CAPACITY_1_GBPS'
362+
- 'CAPACITY_10_GBPS'
363+
- 'CAPACITY_100_GBPS'
318364
- name: 'uniqueId'
319365
type: String
320366
description: Output only. The Google-generated UUID for the spoke. This value is unique across all spoke resources. If a spoke is deleted and another with the same name is created, the new spoke is assigned a different unique_id.

mmv1/products/networkconnectivity/product.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@ display_name: 'Network Connectivity'
1717
versions:
1818
- name: 'ga'
1919
base_url: 'https://networkconnectivity.googleapis.com/v1/'
20+
- name: 'beta'
21+
base_url: 'https://networkconnectivity.googleapis.com/v1beta/'
2022
scopes:
2123
- 'https://www.googleapis.com/auth/cloud-platform'
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
resource "google_compute_network" "network" {
2+
provider = google-beta
3+
name = "{{index $.Vars "network_name"}}"
4+
auto_create_subnetworks = false
5+
}
6+
7+
resource "google_compute_subnetwork" "subnetwork" {
8+
provider = google-beta
9+
name = "tf-test-subnet%{random_suffix}"
10+
ip_cidr_range = "10.0.0.0/28"
11+
region = "us-central1"
12+
network = google_compute_network.network.self_link
13+
}
14+
15+
resource "google_network_connectivity_hub" "basic_hub" {
16+
provider = google-beta
17+
name = "{{index $.Vars "hub_name"}}"
18+
description = "A sample hub"
19+
labels = {
20+
label-two = "value-one"
21+
}
22+
preset_topology = "HYBRID_INSPECTION"
23+
}
24+
25+
resource "google_network_connectivity_spoke" "primary" {
26+
provider = google-beta
27+
name = "{{index $.Vars "spoke_name"}}"
28+
location = "us-central1"
29+
description = "A sample spoke with a linked routher appliance instance"
30+
labels = {
31+
label-one = "value-one"
32+
}
33+
hub = google_network_connectivity_hub.basic_hub.id
34+
gateway {
35+
ip_range_reservations {
36+
ip_range = "10.0.0.0/23"
37+
}
38+
capacity = "CAPACITY_1_GBPS"
39+
}
40+
group = "gateways"
41+
}

0 commit comments

Comments
 (0)