Skip to content

Commit e3b1f32

Browse files
kefang2melinath
andauthored
add new fields and update examples (#15296)
Co-authored-by: Stephen Lewis (Burrows) <[email protected]>
1 parent cbd1a80 commit e3b1f32

9 files changed

+536
-91
lines changed

mmv1/products/discoveryengine/DataConnector.yaml

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ update_mask: true
3333
delete_url: 'projects/{{project}}/locations/{{location}}/collections/{{collection_id}}'
3434
import_format:
3535
- 'projects/{{project}}/locations/{{location}}/collections/{{collection_id}}/dataConnector'
36+
custom_code:
37+
constants: "templates/terraform/constants/discoveryengine_data_connector.go.tmpl"
38+
state_upgraders: true
39+
schema_version: 1
3640
timeouts:
3741
insert_minutes: 20
3842
update_minutes: 5
@@ -46,15 +50,10 @@ async:
4650
result:
4751
resource_inside_response: true
4852
examples:
49-
- name: 'discoveryengine_dataconnector_jira_basic'
50-
primary_resource_id: 'jira-basic'
53+
- name: 'discoveryengine_dataconnector_servicenow_basic'
54+
primary_resource_id: 'servicenow-basic'
5155
vars:
5256
collection_id: 'collection-id'
53-
client_id: 'client-id'
54-
client_secret: 'client-secret'
55-
test_vars_overrides:
56-
client_id: '"tf-test-client-id"'
57-
client_secret: '"tf-test-client-secret"'
5857
parameters:
5958
- name: 'location'
6059
type: String
@@ -86,6 +85,7 @@ parameters:
8685
url_param_only: true
8786
required: true
8887
immutable: true
88+
ignore_read: true
8989
properties:
9090
- name: 'name'
9191
type: String
@@ -168,9 +168,13 @@ properties:
168168
method, a DataStore is automatically created for each source entity.
169169
output: true
170170
- name: 'params'
171-
type: KeyValuePairs
172-
description: |
173-
The parameters for the entity to facilitate data ingestion.
171+
description: 'The parameters for the entity to facilitate data ingestion.'
172+
diff_suppress_func: 'DataConnectorEntitiesParamsDiffSuppress'
173+
custom_flatten: 'templates/terraform/custom_flatten/json_schema.tmpl'
174+
custom_expand: 'templates/terraform/custom_expand/json_schema.tmpl'
175+
state_func: 'func(v interface{}) string { s, _ := structure.NormalizeJsonString(v); return s }'
176+
validation:
177+
function: 'validation.StringIsJSON'
174178
- name: 'createTime'
175179
type: Time
176180
description: |
@@ -275,3 +279,36 @@ properties:
275279
'STATE_UNSPECIFIED', 'CREATING', 'ACTIVE', 'FAILED', 'RUNNING', 'WARNING',
276280
'INITIALIZATION_FAILED', 'UPDATING'.
277281
output: true
282+
- name: 'connectorModes'
283+
type: Array
284+
description: |
285+
The modes enabled for this connector. The possible value can be:
286+
'DATA_INGESTION', 'ACTIONS', 'FEDERATED'
287+
'EUA', 'FEDERATED_AND_EUA'.
288+
item_type:
289+
type: String
290+
- name: 'syncMode'
291+
type: String
292+
description: |
293+
The data synchronization mode supported by the data connector. The possible value can be:
294+
'PERIODIC', 'STREAMING'.
295+
ignore_read: true
296+
- name: 'incrementalRefreshInterval'
297+
type: String
298+
description: |
299+
The refresh interval specifically for incremental data syncs. If unset,
300+
incremental syncs will use the default from env, set to 3hrs.
301+
The minimum is 30 minutes and maximum is 7 days. Applicable to only 3P
302+
connectors. When the refresh interval is
303+
set to the same value as the incremental refresh interval, incremental
304+
sync will be disabled.
305+
- name: 'autoRunDisabled'
306+
type: Boolean
307+
description: |
308+
Indicates whether full syncs are paused for this connector
309+
ignore_read: true
310+
- name: 'incrementalSyncDisabled'
311+
type: Boolean
312+
description: |
313+
Indicates whether incremental syncs are paused for this connector.
314+
ignore_read: true

mmv1/products/discoveryengine/SearchEngine.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,14 @@ properties:
162162
type: KeyValuePairs
163163
description: |
164164
A map of the feature config for the engine to opt in or opt out of features.
165+
- name: 'kmsKeyName'
166+
ignore_read: true
167+
type: String
168+
description: |
169+
The KMS key to be used to protect this Engine at creation time.
170+
171+
Must be set for requests that need to comply with CMEK Org Policy
172+
protections.
173+
174+
If this field is set and processed successfully, the Engine will be
175+
protected by the KMS key, as indicated in the cmek_config field.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
func DataConnectorEntitiesParamsDiffSuppress(k, old, new string, d *schema.ResourceData) bool {
2+
return (old == "" && new == "{}") || (old == "{}" && new == "")
3+
}

mmv1/templates/terraform/examples/discoveryengine_dataconnector_jira_basic.tf.tmpl

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
resource "google_discovery_engine_data_connector" "servicenow-basic" {
2+
location = "global"
3+
collection_id = "{{index $.Vars "collection_id"}}"
4+
collection_display_name = "tf-test-dataconnector-servicenow"
5+
data_source = "servicenow"
6+
params = {
7+
auth_type = "OAUTH_PASSWORD_GRANT"
8+
instance_uri = "https://gcpconnector1.service-now.com/"
9+
client_id = "SECRET_MANAGER_RESOURCE_NAME"
10+
client_secret = "SECRET_MANAGER_RESOURCE_NAME"
11+
static_ip_enabled = "false"
12+
user_account = "[email protected]"
13+
password = "SECRET_MANAGER_RESOURCE_NAME"
14+
}
15+
refresh_interval = "86400s"
16+
incremental_refresh_interval = "21600s"
17+
entities {
18+
entity_name = "catalog"
19+
params = jsonencode({
20+
"inclusion_filters": {
21+
"knowledgeBaseSysId": [
22+
"123"
23+
]
24+
}
25+
})
26+
}
27+
entities {
28+
entity_name = "incident"
29+
params = jsonencode({
30+
"inclusion_filters": {
31+
"knowledgeBaseSysId": [
32+
"123"
33+
]
34+
}
35+
})
36+
}
37+
entities {
38+
entity_name = "knowledge_base"
39+
params = jsonencode({
40+
"inclusion_filters": {
41+
"knowledgeBaseSysId": [
42+
"123"
43+
]
44+
}
45+
})
46+
}
47+
static_ip_enabled = false
48+
connector_modes = ["DATA_INGESTION"]
49+
sync_mode = "PERIODIC"
50+
}

mmv1/templates/terraform/examples/discoveryengine_searchengine_agentspace_basic.tf.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ resource "google_discovery_engine_search_engine" "agentspace_basic" {
1414
display_name = "tf-test-agentspace-search-engine"
1515
data_store_ids = [google_discovery_engine_data_store.agentspace_basic.data_store_id]
1616
industry_vertical = "GENERIC"
17+
app_type = "APP_TYPE_INTRANET"
1718
search_engine_config {
1819
}
1920
}

0 commit comments

Comments
 (0)