Skip to content

Commit 7cf5fd5

Browse files
authored
Support the new Broker type of mirroring endpoint group. (#15212)
1 parent c4a3f1c commit 7cf5fd5

File tree

2 files changed

+60
-1
lines changed

2 files changed

+60
-1
lines changed

mmv1/products/networksecurity/MirroringEndpointGroup.yaml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ examples:
5252
network_name: 'example-network'
5353
deployment_group_id: 'example-dg'
5454
endpoint_group_id: 'example-eg'
55+
- name: 'network_security_mirroring_endpoint_group_broker_basic'
56+
config_path: 'templates/terraform/examples/network_security_mirroring_endpoint_group_broker_basic.tf.tmpl'
57+
primary_resource_id: 'default'
58+
min_version: 'beta'
59+
vars:
60+
network_name: 'example-network'
61+
deployment_group_id: 'example-dg'
62+
endpoint_group_id: 'example-eg'
5563
parameters:
5664
- name: 'location'
5765
type: String
@@ -99,8 +107,24 @@ properties:
99107
The deployment group that this DIRECT endpoint group is connected to, for example:
100108
`projects/123456789/locations/global/mirroringDeploymentGroups/my-dg`.
101109
See https://google.aip.dev/124.
102-
required: true
103110
immutable: true
111+
exactly_one_of:
112+
- mirroring_deployment_group
113+
- mirroring_deployment_groups
114+
- name: 'mirroringDeploymentGroups'
115+
type: Array
116+
description: |-
117+
A list of the deployment groups that this BROKER endpoint group is
118+
connected to, for example:
119+
`projects/123456789/locations/global/mirroringDeploymentGroups/my-dg`.
120+
See https://google.aip.dev/124.
121+
min_version: 'beta'
122+
immutable: true
123+
item_type:
124+
type: String
125+
exactly_one_of:
126+
- mirroring_deployment_group
127+
- mirroring_deployment_groups
104128
- name: 'state'
105129
type: String
106130
description: |-
@@ -123,6 +147,17 @@ properties:
123147
operation (e.g. adding a new association to the group).
124148
See https://google.aip.dev/128.
125149
output: true
150+
- name: 'type'
151+
type: String
152+
description: |-
153+
The type of the endpoint group.
154+
If left unspecified, defaults to DIRECT.
155+
Possible values:
156+
DIRECT
157+
BROKER
158+
min_version: 'beta'
159+
default_value: 'DIRECT'
160+
immutable: true
126161
- name: description
127162
type: String
128163
description: |-
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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_network_security_mirroring_deployment_group" "deployment_group" {
8+
provider = google-beta
9+
mirroring_deployment_group_id = "{{index $.Vars "deployment_group_id"}}"
10+
location = "global"
11+
network = google_compute_network.network.id
12+
}
13+
14+
resource "google_network_security_mirroring_endpoint_group" "{{$.PrimaryResourceId}}" {
15+
provider = google-beta
16+
mirroring_endpoint_group_id = "{{index $.Vars "endpoint_group_id"}}"
17+
location = "global"
18+
type = "BROKER"
19+
mirroring_deployment_groups = [google_network_security_mirroring_deployment_group.deployment_group.id]
20+
description = "some description"
21+
labels = {
22+
foo = "bar"
23+
}
24+
}

0 commit comments

Comments
 (0)