Skip to content

Commit 29e196d

Browse files
authored
Add a new resource google_discovery_engine_data_connector (#14890)
1 parent a879f0c commit 29e196d

File tree

3 files changed

+427
-0
lines changed

3 files changed

+427
-0
lines changed
Lines changed: 277 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,277 @@
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: 'DataConnector'
16+
api_variant_patterns:
17+
- 'projects/{project}/locations/{location}/collections/{collection}/dataConnector'
18+
description: |
19+
DataConnector manages the connection to external data sources for all data stores grouped
20+
under a Collection. It's a singleton resource of Collection. The initialization is only
21+
supported through DataConnectorService.SetUpDataConnector method, which will create a new
22+
Collection and initialize its DataConnector.
23+
references:
24+
guides:
25+
'Introduction': 'https://cloud.google.com/agentspace/docs/introduction-to-connectors-and-data-stores'
26+
api: 'https://cloud.google.com/generative-ai-app-builder/docs/reference/rpc/google.cloud.discoveryengine.v1alpha#dataconnectorservice'
27+
base_url: 'projects/{{project}}/locations/{{location}}/collections/{{collection_id}}/dataConnector'
28+
self_link: 'projects/{{project}}/locations/{{location}}/collections/{{collection_id}}/dataConnector'
29+
create_url: 'projects/{{project}}/locations/{{location}}:setUpDataConnectorV2?collectionId={{collection_id}}&collectionDisplayName={{collection_display_name}}'
30+
update_url: 'projects/{{project}}/locations/{{location}}/collections/{{collection_id}}/dataConnector'
31+
update_verb: 'PATCH'
32+
update_mask: true
33+
delete_url: 'projects/{{project}}/locations/{{location}}/collections/{{collection_id}}'
34+
import_format:
35+
- 'projects/{{project}}/locations/{{location}}/collections/{{collection_id}}/dataConnector'
36+
timeouts:
37+
insert_minutes: 20
38+
update_minutes: 5
39+
delete_minutes: 20
40+
autogen_async: false
41+
async:
42+
actions: ['create', 'delete']
43+
type: 'OpAsync'
44+
operation:
45+
base_url: '{{op_id}}'
46+
result:
47+
resource_inside_response: true
48+
examples:
49+
- name: 'discoveryengine_dataconnector_jira_basic'
50+
primary_resource_id: 'jira-basic'
51+
vars:
52+
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"'
58+
parameters:
59+
- name: 'location'
60+
type: String
61+
description: |
62+
The geographic location where the data store should reside. The value can
63+
only be one of "global", "us" and "eu".
64+
url_param_only: true
65+
required: true
66+
immutable: true
67+
- name: 'collectionId'
68+
type: String
69+
description: |
70+
The ID to use for the Collection, which will become the final component
71+
of the Collection's resource name. A new Collection is created as
72+
part of the DataConnector setup. DataConnector is a singleton
73+
resource under Collection, managing all DataStores of the Collection.
74+
This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034)
75+
standard with a length limit of 63 characters. Otherwise, an
76+
INVALID_ARGUMENT error is returned.
77+
url_param_only: true
78+
required: true
79+
immutable: true
80+
- name: 'collectionDisplayName'
81+
type: String
82+
description: |
83+
The display name of the Collection.
84+
Should be human readable, used to display collections in the Console
85+
Dashboard. UTF-8 encoded string with limit of 1024 characters.
86+
url_param_only: true
87+
required: true
88+
immutable: true
89+
properties:
90+
- name: 'name'
91+
type: String
92+
description: |
93+
The full resource name of the Data Connector.
94+
Format: `projects/*/locations/*/collections/*/dataConnector`.
95+
output: true
96+
- name: 'state'
97+
type: String
98+
description: |
99+
The state of connector. The possible value can be:
100+
'STATE_UNSPECIFIED', 'CREATING', 'ACTIVE', 'FAILED', 'RUNNING', 'WARNING',
101+
'INITIALIZATION_FAILED', 'UPDATING'.
102+
output: true
103+
- name: 'dataSource'
104+
type: String
105+
description: |
106+
The name of the data source.
107+
Supported values: `salesforce`, `jira`, `confluence`, `bigquery`.
108+
required: true
109+
immutable: true
110+
- name: 'params'
111+
type: KeyValuePairs
112+
description: |
113+
Params needed to access the source in the format of String-to-String (Key, Value) pairs.
114+
ignore_read: true
115+
exactly_one_of:
116+
- params
117+
- json_params
118+
- name: 'jsonParams'
119+
type: String
120+
description: |
121+
Params needed to access the source in the format of json string.
122+
ignore_read: true
123+
exactly_one_of:
124+
- params
125+
- json_params
126+
- name: 'refreshInterval'
127+
type: String
128+
description: |
129+
The refresh interval for data sync. If duration is set to 0, the data will
130+
be synced in real time. The streaming feature is not supported yet. The
131+
minimum is 30 minutes and maximum is 7 days. When the refresh interval is
132+
set to the same value as the incremental refresh interval, incremental
133+
sync will be disabled.
134+
required: true
135+
- name: 'entities'
136+
type: Array
137+
description: |
138+
List of entities from the connected data source to ingest.
139+
immutable: true
140+
item_type:
141+
type: NestedObject
142+
properties:
143+
- name: 'entityName'
144+
type: String
145+
description: |
146+
The name of the entity. Supported values by data source:
147+
* Salesforce: `Lead`, `Opportunity`, `Contact`, `Account`, `Case`, `Contract`, `Campaign`
148+
* Jira: project, issue, attachment, comment, worklog
149+
* Confluence: `Content`, `Space`
150+
- name: 'keyPropertyMappings'
151+
type: KeyValuePairs
152+
description: |
153+
Attributes for indexing.
154+
Key: Field name.
155+
Value: The key property to map a field to, such as `title`, and
156+
`description`. Supported key properties:
157+
* `title`: The title for data record. This would be displayed on search
158+
results.
159+
* `description`: The description for data record. This would be displayed
160+
on search results.
161+
- name: 'dataStore'
162+
type: String
163+
description: |
164+
The full resource name of the associated data store for the source
165+
entity.
166+
Format: `projects/*/locations/*/collections/*/dataStores/*`.
167+
When the connector is initialized by the DataConnectorService.SetUpDataConnector
168+
method, a DataStore is automatically created for each source entity.
169+
output: true
170+
- name: 'params'
171+
type: KeyValuePairs
172+
description: |
173+
The parameters for the entity to facilitate data ingestion.
174+
- name: 'createTime'
175+
type: Time
176+
description: |
177+
Timestamp when the DataConnector was created.
178+
output: true
179+
- name: 'latestPauseTime'
180+
type: Time
181+
description: |
182+
The most recent timestamp when this [DataConnector][] was paused,
183+
affecting all functionalities such as data synchronization.
184+
Pausing a connector has the following effects:
185+
- All functionalities, including data synchronization, are halted.
186+
- Any ongoing data synchronization job will be canceled.
187+
- No future data synchronization runs will be scheduled nor can be
188+
triggered.
189+
output: true
190+
- name: 'lastSyncTime'
191+
type: Time
192+
description: |
193+
For periodic connectors only, the last time a data sync was completed.
194+
output: true
195+
- name: 'updateTime'
196+
type: Time
197+
description: |
198+
Timestamp when the DataConnector was updated.
199+
output: true
200+
- name: 'errors'
201+
type: Array
202+
description: |
203+
The errors from initialization or from the latest connector run.
204+
output: true
205+
item_type:
206+
type: NestedObject
207+
properties:
208+
- name: 'code'
209+
type: Integer
210+
description: |
211+
The status code, which should be an enum value of google.rpc.Code.
212+
output: true
213+
- name: 'message'
214+
type: String
215+
description: |
216+
A developer-facing error message, which should be in English.
217+
output: true
218+
- name: 'kmsKeyName'
219+
type: String
220+
description: |
221+
The KMS key to be used to protect the DataStores managed by this connector.
222+
Must be set for requests that need to comply with CMEK Org Policy
223+
protections.
224+
If this field is set and processed successfully, the DataStores created by
225+
this connector will be protected by the KMS key.
226+
immutable: true
227+
- name: 'actionState'
228+
type: String
229+
description: |
230+
State of the action connector. This reflects whether the action connector
231+
is initializing, active or has encountered errors. The possible value can be:
232+
'STATE_UNSPECIFIED', 'CREATING', 'ACTIVE', 'FAILED', 'RUNNING', 'WARNING',
233+
'INITIALIZATION_FAILED', 'UPDATING'.
234+
output: true
235+
- name: 'staticIpEnabled'
236+
type: Boolean
237+
description: |
238+
Whether customer has enabled static IP addresses for this connector.
239+
immutable: true
240+
- name: 'staticIpAddresses'
241+
type: Array
242+
description: |
243+
The static IP addresses used by this connector.
244+
output: true
245+
item_type:
246+
type: String
247+
- name: 'blockingReasons'
248+
type: Array
249+
description: |
250+
User actions that must be completed before the connector can start syncing data.
251+
The possible values can be: 'ALLOWLIST_STATIC_IP', 'ALLOWLIST_IN_SERVICE_ATTACHMENT'.
252+
output: true
253+
item_type:
254+
type: String
255+
- name: 'privateConnectivityProjectId'
256+
type: String
257+
description: |
258+
The tenant project ID associated with private connectivity connectors.
259+
This project must be allowlisted by in order for the connector to function.
260+
output: true
261+
- name: 'connectorType'
262+
type: String
263+
description: |
264+
The type of connector. Each source can only map to one type.
265+
For example, salesforce, confluence and jira have THIRD_PARTY connector
266+
type. It is not mutable once set by system. The possible value can be:
267+
'CONNECTOR_TYPE_UNSPECIFIED', 'THIRD_PARTY', 'GCP_FHIR', 'BIG_QUERY',
268+
'GCS', 'GOOGLE_MAIL', 'GOOGLE_CALENDAR', 'GOOGLE_DRIVE',
269+
'NATIVE_CLOUD_IDENTITY', 'THIRD_PARTY_FEDERATED', 'THIRD_PARTY_EUA', 'GCNV'.
270+
output: true
271+
- name: 'realtimeState'
272+
type: String
273+
description: |
274+
The real-time sync state. The possible values can be:
275+
'STATE_UNSPECIFIED', 'CREATING', 'ACTIVE', 'FAILED', 'RUNNING', 'WARNING',
276+
'INITIALIZATION_FAILED', 'UPDATING'.
277+
output: true
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
resource "google_discovery_engine_data_connector" "jira-basic" {
2+
location = "global"
3+
collection_id = "{{index $.Vars "collection_id"}}"
4+
collection_display_name = "tf-test-dataconnector-jira"
5+
data_source = "jira"
6+
params = {
7+
instance_id = "33db20a3-dc45-4305-a505-d70b68599840"
8+
instance_uri = "https://vaissptbots1.atlassian.net/"
9+
client_secret = "{{index $.Vars "client_secret"}}"
10+
client_id = "{{index $.Vars "client_id"}}"
11+
refresh_token = "fill-in-the-blank"
12+
}
13+
refresh_interval = "86400s"
14+
entities {
15+
entity_name = "project"
16+
}
17+
entities {
18+
entity_name = "issue"
19+
}
20+
entities {
21+
entity_name = "attachment"
22+
}
23+
entities {
24+
entity_name = "comment"
25+
}
26+
entities {
27+
entity_name = "worklog"
28+
}
29+
static_ip_enabled = true
30+
}

0 commit comments

Comments
 (0)