Skip to content

Commit c20da38

Browse files
add terraform support to SAC realm (#15650)
1 parent f7c8bb7 commit c20da38

File tree

3 files changed

+138
-0
lines changed

3 files changed

+138
-0
lines changed
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Copyright 2025 Google Inc.
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
14+
---
15+
name: 'SacRealm'
16+
description: "Secure Access Connect Realm resource"
17+
references:
18+
guides:
19+
'QUICKSTART_TITLE': 'https://cloud.google.com/secure-access-connect/docs/overview'
20+
api: 'https://cloud.google.com/secure-access-connect/docs/reference/network-security/rest/v1beta1/projects.locations.sacRealms'
21+
min_version: beta
22+
23+
base_url: 'projects/{{project}}/locations/global/sacRealms'
24+
self_link: 'projects/{{project}}/locations/global/sacRealms/{{name}}'
25+
immutable: true
26+
create_url: 'projects/{{project}}/locations/global/sacRealms?sacRealmId={{name}}'
27+
autogen_async: true
28+
async:
29+
operation:
30+
base_url: '{{op_id}}'
31+
examples:
32+
- name: 'sac_realm_prisma_access'
33+
min_version: beta
34+
primary_resource_id: 'default'
35+
vars:
36+
resource_name: 'sac-realm-name'
37+
- name: 'sac_realm_symantec_cloud_swg'
38+
min_version: beta
39+
exclude_test: true
40+
primary_resource_id: 'default'
41+
vars:
42+
resource_name: 'sac-realm-name'
43+
secret_path: 'secret-path'
44+
properties:
45+
- name: 'name'
46+
type: String
47+
required: true
48+
immutable: true
49+
description: |
50+
Identifier. Resource name.
51+
custom_flatten: 'templates/terraform/custom_flatten/id_from_name.tmpl'
52+
- name: 'createTime'
53+
type: String
54+
description: Timestamp when the realm was created.
55+
output: true
56+
- name: 'updateTime'
57+
type: String
58+
description: Timestamp when the realm was last updated.
59+
output: true
60+
- name: 'labels'
61+
type: KeyValueLabels
62+
description: |
63+
Optional labels in key:value format. For more information about labels, see [Requirements for labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
64+
- name: 'pairingKey'
65+
type: NestedObject
66+
description: Key to be shared with SSE service provider during pairing.
67+
properties:
68+
- name: 'key'
69+
type: String
70+
description: Key value.
71+
output: true
72+
- name: 'expireTime'
73+
type: String
74+
description: Timestamp in UTC of when this resource is considered expired. It expires 7 days after creation.
75+
output: true
76+
output: true
77+
- name: 'securityService'
78+
type: Enum
79+
description: SSE service provider associated with the realm.
80+
required: true
81+
immutable: true
82+
enum_values:
83+
- 'SECURITY_SERVICE_UNSPECIFIED'
84+
- 'PALO_ALTO_PRISMA_ACCESS'
85+
- 'SYMANTEC_CLOUD_SWG'
86+
- name: 'state'
87+
type: Enum
88+
description: State of the realm.
89+
output: true
90+
enum_values:
91+
- 'STATE_UNSPECIFIED'
92+
- 'PENDING_PARTNER_ATTACHMENT'
93+
- 'PARTNER_ATTACHED'
94+
- 'PARTNER_DETACHED'
95+
- 'KEY_EXPIRED'
96+
- name: 'symantecOptions'
97+
description: Configuration required for Symantec realms.
98+
type: NestedObject
99+
properties:
100+
- name: 'availableSymantecSites'
101+
type: Array
102+
description: Symantec site IDs which the user can choose to connect to.
103+
output: true
104+
item_type:
105+
type: String
106+
- name: 'secretPath'
107+
type: String
108+
description: |
109+
API Key used to call Symantec APIs on the user's behalf. Required if using Symantec Cloud SWG. P4SA account needs permissions granted to read this secret.
110+
A secret ID, secret name, or secret URI can be specified, but it will be parsed and stored as a secret URI in the form projects/{projectNumber}/secrets/my-secret.
111+
- name: "symantecConnectionState"
112+
type: Enum
113+
description: Connection status to Symantec API
114+
output: true
115+
enum_values:
116+
- 'SYMANTEC_CONNECTION_STATE_UNSPECIFIED'
117+
- 'SUCCEEDED'
118+
- 'READ_SECRET_FAILED'
119+
- 'REQUEST_TO_SYMANTEC_FAILED'
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
resource "google_network_security_sac_realm" "{{$.PrimaryResourceId}}" {
2+
provider = google-beta
3+
name = "{{index $.Vars "resource_name"}}"
4+
labels = {
5+
label-one = "value-one"
6+
}
7+
security_service = "PALO_ALTO_PRISMA_ACCESS"
8+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
resource "google_network_security_sac_realm" "{{$.PrimaryResourceId}}" {
2+
provider = google-beta
3+
name = "{{index $.Vars "resource_name"}}"
4+
labels = {
5+
label-one = "value-one"
6+
}
7+
security_service = "SYMANTEC_CLOUD_SWG"
8+
symantecOptions = {
9+
secretPath = "{{index $.Vars "secret_path"}}"
10+
}
11+
}

0 commit comments

Comments
 (0)