Skip to content

Commit

Permalink
Add group field to google_network_connectivity_spoke (#12537)
Browse files Browse the repository at this point in the history
  • Loading branch information
septikus authored Dec 13, 2024
1 parent 3b3cb68 commit 9e83dc2
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
11 changes: 11 additions & 0 deletions mmv1/products/networkconnectivity/Spoke.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ examples:
network_name: 'net'
hub_name: 'hub1'
spoke_name: 'spoke1'
- name: 'network_connectivity_spoke_linked_vpc_network_group'
primary_resource_id: 'primary'
vars:
network_name: 'net-spoke'
hub_name: 'hub1-spoke'
spoke_name: 'group-spoke1'
- name: 'network_connectivity_spoke_router_appliance_basic'
primary_resource_id: 'primary'
vars:
Expand Down Expand Up @@ -122,6 +128,11 @@ properties:
immutable: true
resource: 'hub'
imports: 'name'
- name: 'group'
type: String
description: The name of the group that this spoke is associated with.
immutable: true
default_from_api: true
- name: 'linkedVpnTunnels'
type: NestedObject
description: The URIs of linked VPN tunnel resources
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
resource "google_compute_network" "network" {
name = "{{index $.Vars "network_name"}}"
auto_create_subnetworks = false
}

resource "google_network_connectivity_hub" "basic_hub" {
name = "{{index $.Vars "hub_name"}}"
description = "A sample hub"
labels = {
label-two = "value-one"
}
}

resource "google_network_connectivity_group" "default_group" {
hub = google_network_connectivity_hub.basic_hub.id
name = "default"
description = "A sample hub group"
}

resource "google_network_connectivity_spoke" "{{$.PrimaryResourceId}}" {
name = "{{index $.Vars "spoke_name"}}"
location = "global"
description = "A sample spoke with a linked VPC"
labels = {
label-one = "value-one"
}
hub = google_network_connectivity_hub.basic_hub.id
linked_vpc_network {
exclude_export_ranges = [
"198.51.100.0/24",
"10.10.0.0/16"
]
include_export_ranges = [
"198.51.100.0/23",
"10.0.0.0/8"
]
uri = google_compute_network.network.self_link
}
group = google_network_connectivity_group.default_group.id
}

0 comments on commit 9e83dc2

Please sign in to comment.