Skip to content

Commit e65793c

Browse files
authored
Add SPA fields to beyondcorp_security_gateway_application (#15233)
1 parent 61a1369 commit e65793c

File tree

3 files changed

+170
-1
lines changed

3 files changed

+170
-1
lines changed

mmv1/products/beyondcorp/SecurityGatewayApplication.yaml

Lines changed: 106 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,18 @@ examples:
4343
vars:
4444
security_gateway_name: default-sg
4545
application_name: my-vm-service2
46+
- name: beyondcorp_security_gateway_application_spa_api
47+
primary_resource_id: example-spa
48+
primary_resource_name: 'fmt.Sprintf("tf-test-default-sg-spa-api%s", context["random_suffix"]), fmt.Sprintf("tf-test-google-sga%s", context["random_suffix"])'
49+
vars:
50+
security_gateway_name: default-sg-spa-api
51+
application_discovery_name: app-discovery
52+
- name: beyondcorp_security_gateway_application_spa_proxy
53+
primary_resource_id: example-spa
54+
primary_resource_name: 'fmt.Sprintf("tf-test-default-sg-spa-proxy%s", context["random_suffix"]), fmt.Sprintf("tf-test-google-sga%s", context["random_suffix"])'
55+
vars:
56+
security_gateway_name: default-sg-spa-proxy
57+
application_proxy_name: app-proxy
4658
autogen_async: true
4759
async:
4860
operation:
@@ -102,7 +114,6 @@ properties:
102114
EXAMPLES:
103115
Hostname - ("*.abc.com"), ("xyz.abc.com")
104116
Hostname and Ports - ("abc.com" and "22"), ("abc.com" and "22,33") etc
105-
required: true
106117
item_type:
107118
type: NestedObject
108119
properties:
@@ -141,6 +152,100 @@ properties:
141152
Required. Network name is of the format:
142153
`projects/{project}/global/networks/{network}`
143154
required: true
155+
- name: external
156+
type: NestedObject
157+
description: List of the external endpoints to forward traffic to.
158+
properties:
159+
- name: endpoints
160+
type: Array
161+
description: List of the endpoints to forward traffic to.
162+
required: true
163+
item_type:
164+
type: NestedObject
165+
properties:
166+
- name: hostname
167+
type: String
168+
description: Hostname of the endpoint.
169+
required: true
170+
- name: port
171+
type: Integer
172+
description: Port of the endpoint.
173+
required: true
174+
- name: proxyProtocol
175+
type: NestedObject
176+
description: Shared proxy configuration for all apps.
177+
properties:
178+
- name: allowedClientHeaders
179+
type: Array
180+
description: The configuration for the proxy.
181+
item_type:
182+
type: string
183+
- name: contextualHeaders
184+
type: NestedObject
185+
description: Configuration for the contextual headers.
186+
properties:
187+
- name: userInfo
188+
type: NestedObject
189+
description: User info configuration.
190+
properties:
191+
- name: outputType
192+
type: Enum
193+
description: The output type of the delegated user info.
194+
enum_values:
195+
- 'PROTOBUF'
196+
- 'JSON'
197+
- 'NONE'
198+
- name: groupInfo
199+
type: NestedObject
200+
description: Group info configuration.
201+
properties:
202+
- name: outputType
203+
type: Enum
204+
description: The output type of the delegated group info.
205+
enum_values:
206+
- 'PROTOBUF'
207+
- 'JSON'
208+
- 'NONE'
209+
- name: deviceInfo
210+
type: NestedObject
211+
description: Device info configuration.
212+
properties:
213+
- name: outputType
214+
type: Enum
215+
description: The output type of the delegated device info.
216+
enum_values:
217+
- 'PROTOBUF'
218+
- 'JSON'
219+
- 'NONE'
220+
- name: outputType
221+
type: Enum
222+
description: Default output type for all enabled headers.
223+
enum_values:
224+
- 'PROTOBUF'
225+
- 'JSON'
226+
- 'NONE'
227+
- name: metadataHeaders
228+
type: KeyValuePairs
229+
description: |-
230+
Custom resource specific headers along with the values.
231+
The names should conform to RFC 9110:
232+
> Field names SHOULD constrain themselves to alphanumeric characters, "-",
233+
and ".", and SHOULD begin with a letter.
234+
> Field values SHOULD contain only ASCII printable characters and tab.
235+
- name: gatewayIdentity
236+
type: Enum
237+
description: Gateway identity configuration.
238+
enum_values:
239+
- 'RESOURCE_NAME'
240+
- name: clientIp
241+
type: Boolean
242+
description: Client IP configuration. The client IP address is included if true.
243+
- name: schema
244+
type: Enum
245+
description: Type of the external application.
246+
enum_values:
247+
- 'PROXY_GATEWAY'
248+
- 'API_GATEWAY'
144249
- name: name
145250
type: String
146251
description: Identifier. Name of the resource.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
resource "google_beyondcorp_security_gateway" "default" {
2+
security_gateway_id = "{{index $.Vars "security_gateway_name"}}"
3+
display_name = "My SPA Security Gateway resource"
4+
}
5+
6+
resource "google_beyondcorp_security_gateway_application" "{{$.PrimaryResourceId}}" {
7+
security_gateway_id = google_beyondcorp_security_gateway.default.security_gateway_id
8+
application_id = "{{index $.Vars "application_discovery_name"}}"
9+
upstreams {
10+
external {
11+
endpoints {
12+
hostname = "my.discovery.service.com"
13+
port = 443
14+
}
15+
}
16+
proxy_protocol {
17+
allowed_client_headers= ["header"]
18+
}
19+
}
20+
schema = "API_GATEWAY"
21+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
resource "google_beyondcorp_security_gateway" "default" {
2+
security_gateway_id = "{{index $.Vars "security_gateway_name"}}"
3+
display_name = "My SPA Security Gateway resource"
4+
}
5+
6+
resource "google_beyondcorp_security_gateway_application" "{{$.PrimaryResourceId}}" {
7+
security_gateway_id = google_beyondcorp_security_gateway.default.security_gateway_id
8+
application_id = "{{index $.Vars "application_proxy_name"}}"
9+
endpoint_matchers {
10+
hostname = "a.site.com"
11+
ports = [443]
12+
}
13+
upstreams {
14+
external {
15+
endpoints {
16+
hostname = "my.proxy.service.com"
17+
port = 443
18+
}
19+
}
20+
proxy_protocol {
21+
allowed_client_headers = ["header1", "header2"]
22+
contextual_headers {
23+
user_info {
24+
output_type = "PROTOBUF"
25+
}
26+
group_info {
27+
output_type = "JSON"
28+
}
29+
device_info {
30+
output_type = "NONE"
31+
}
32+
output_type = "JSON"
33+
}
34+
metadata_headers = {
35+
metadata-header1 = "value1"
36+
metadata-header2 = "value2"
37+
}
38+
gateway_identity = "RESOURCE_NAME"
39+
client_ip = true
40+
}
41+
}
42+
schema = "PROXY_GATEWAY"
43+
}

0 commit comments

Comments
 (0)