@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
313 lines • 13.9 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DataConnector = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
* DataConnector manages the connection to external data sources for all data stores grouped
* under a Collection. It's a singleton resource of Collection. The initialization is only
* supported through DataConnectorService.SetUpDataConnector method, which will create a new
* Collection and initialize its DataConnector.
*
* To get more information about DataConnector, see:
*
* * [API documentation](https://cloud.google.com/generative-ai-app-builder/docs/reference/rpc/google.cloud.discoveryengine.v1alpha#dataconnectorservice)
* * How-to Guides
* * [Introduction](https://cloud.google.com/agentspace/docs/introduction-to-connectors-and-data-stores)
*
* ## Example Usage
*
* ### Discoveryengine Dataconnector Servicenow Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const servicenow_basic = new gcp.discoveryengine.DataConnector("servicenow-basic", {
* location: "global",
* collectionId: "collection-id",
* collectionDisplayName: "tf-test-dataconnector-servicenow",
* dataSource: "servicenow",
* params: {
* auth_type: "OAUTH_PASSWORD_GRANT",
* instance_uri: "https://gcpconnector1.service-now.com/",
* client_id: "SECRET_MANAGER_RESOURCE_NAME",
* client_secret: "SECRET_MANAGER_RESOURCE_NAME",
* static_ip_enabled: "false",
* user_account: "connectorsuserqa@google.com",
* password: "SECRET_MANAGER_RESOURCE_NAME",
* },
* refreshInterval: "86400s",
* incrementalRefreshInterval: "21600s",
* entities: [
* {
* entityName: "catalog",
* params: JSON.stringify({
* inclusion_filters: {
* knowledgeBaseSysId: ["123"],
* },
* }),
* },
* {
* entityName: "incident",
* params: JSON.stringify({
* inclusion_filters: {
* knowledgeBaseSysId: ["123"],
* },
* }),
* },
* {
* entityName: "knowledge_base",
* params: JSON.stringify({
* inclusion_filters: {
* knowledgeBaseSysId: ["123"],
* },
* }),
* },
* ],
* staticIpEnabled: false,
* connectorModes: ["DATA_INGESTION"],
* syncMode: "PERIODIC",
* });
* ```
* ### Discoveryengine Dataconnector Jira With Actions
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const jira_with_actions = new gcp.discoveryengine.DataConnector("jira-with-actions", {
* location: "global",
* collectionId: "collection-id",
* collectionDisplayName: "Jira Federated",
* dataSource: "jira",
* dataSourceVersion: 3,
* params: {
* instance_uri: "https://example.atlassian.net",
* instance_id: "SECRET_MANAGER_RESOURCE_NAME",
* client_id: "SECRET_MANAGER_RESOURCE_NAME",
* client_secret: "SECRET_MANAGER_RESOURCE_NAME",
* refresh_token: "SECRET_MANAGER_RESOURCE_NAME",
* auth_type: "OAUTH",
* },
* refreshInterval: "86400s",
* entities: [
* {
* entityName: "project",
* },
* {
* entityName: "issue",
* },
* {
* entityName: "comment",
* },
* {
* entityName: "attachment",
* },
* ],
* staticIpEnabled: false,
* destinationConfigs: [{
* key: "url",
* destinations: [{
* host: "https://example.atlassian.net",
* port: 123,
* }],
* params: JSON.stringify({
* destination_type: "private",
* }),
* }],
* connectorModes: [
* "FEDERATED",
* "ACTIONS",
* ],
* syncMode: "PERIODIC",
* autoRunDisabled: true,
* incrementalSyncDisabled: true,
* actionConfig: {
* actionParams: {
* instance_uri: "https://example.atlassian.net",
* instance_id: "SECRET_MANAGER_RESOURCE_NAME",
* client_id: "SECRET_MANAGER_RESOURCE_NAME",
* client_secret: "SECRET_MANAGER_RESOURCE_NAME",
* auth_type: "OAUTH",
* },
* createBapConnection: true,
* },
* bapConfig: {
* supportedConnectorModes: ["ACTIONS"],
* enabledActions: [
* "create_issue",
* "update_issue",
* "change_issue_status",
* "create_comment",
* "update_comment",
* "upload_attachment",
* ],
* },
* });
* ```
*
* ## Import
*
* DataConnector can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/collections/{{collection_id}}/dataConnector`
* * `{{project}}/{{location}}/{{collection_id}}`
* * `{{location}}/{{collection_id}}`
*
* When using the `pulumi import` command, DataConnector can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:discoveryengine/dataConnector:DataConnector default projects/{{project}}/locations/{{location}}/collections/{{collection_id}}/dataConnector
* $ pulumi import gcp:discoveryengine/dataConnector:DataConnector default {{project}}/{{location}}/{{collection_id}}
* $ pulumi import gcp:discoveryengine/dataConnector:DataConnector default {{location}}/{{collection_id}}
* ```
*/
class DataConnector extends pulumi.CustomResource {
/**
* Get an existing DataConnector resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new DataConnector(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'gcp:discoveryengine/dataConnector:DataConnector';
/**
* Returns true if the given object is an instance of DataConnector. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === DataConnector.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["actionConfig"] = state?.actionConfig;
resourceInputs["actionState"] = state?.actionState;
resourceInputs["autoRunDisabled"] = state?.autoRunDisabled;
resourceInputs["bapConfig"] = state?.bapConfig;
resourceInputs["blockingReasons"] = state?.blockingReasons;
resourceInputs["collectionDisplayName"] = state?.collectionDisplayName;
resourceInputs["collectionId"] = state?.collectionId;
resourceInputs["connectorModes"] = state?.connectorModes;
resourceInputs["connectorType"] = state?.connectorType;
resourceInputs["createTime"] = state?.createTime;
resourceInputs["dataSource"] = state?.dataSource;
resourceInputs["dataSourceVersion"] = state?.dataSourceVersion;
resourceInputs["deletionPolicy"] = state?.deletionPolicy;
resourceInputs["destinationConfigs"] = state?.destinationConfigs;
resourceInputs["entities"] = state?.entities;
resourceInputs["errors"] = state?.errors;
resourceInputs["incrementalRefreshInterval"] = state?.incrementalRefreshInterval;
resourceInputs["incrementalSyncDisabled"] = state?.incrementalSyncDisabled;
resourceInputs["jsonParams"] = state?.jsonParams;
resourceInputs["kmsKeyName"] = state?.kmsKeyName;
resourceInputs["lastSyncTime"] = state?.lastSyncTime;
resourceInputs["latestPauseTime"] = state?.latestPauseTime;
resourceInputs["location"] = state?.location;
resourceInputs["name"] = state?.name;
resourceInputs["params"] = state?.params;
resourceInputs["privateConnectivityProjectId"] = state?.privateConnectivityProjectId;
resourceInputs["project"] = state?.project;
resourceInputs["realtimeState"] = state?.realtimeState;
resourceInputs["refreshInterval"] = state?.refreshInterval;
resourceInputs["state"] = state?.state;
resourceInputs["staticIpAddresses"] = state?.staticIpAddresses;
resourceInputs["staticIpEnabled"] = state?.staticIpEnabled;
resourceInputs["syncMode"] = state?.syncMode;
resourceInputs["updateTime"] = state?.updateTime;
}
else {
const args = argsOrState;
if (args?.collectionDisplayName === undefined && !opts.urn) {
throw new Error("Missing required property 'collectionDisplayName'");
}
if (args?.collectionId === undefined && !opts.urn) {
throw new Error("Missing required property 'collectionId'");
}
if (args?.dataSource === undefined && !opts.urn) {
throw new Error("Missing required property 'dataSource'");
}
if (args?.location === undefined && !opts.urn) {
throw new Error("Missing required property 'location'");
}
if (args?.refreshInterval === undefined && !opts.urn) {
throw new Error("Missing required property 'refreshInterval'");
}
resourceInputs["actionConfig"] = args?.actionConfig;
resourceInputs["autoRunDisabled"] = args?.autoRunDisabled;
resourceInputs["bapConfig"] = args?.bapConfig;
resourceInputs["collectionDisplayName"] = args?.collectionDisplayName;
resourceInputs["collectionId"] = args?.collectionId;
resourceInputs["connectorModes"] = args?.connectorModes;
resourceInputs["dataSource"] = args?.dataSource;
resourceInputs["dataSourceVersion"] = args?.dataSourceVersion;
resourceInputs["deletionPolicy"] = args?.deletionPolicy;
resourceInputs["destinationConfigs"] = args?.destinationConfigs;
resourceInputs["entities"] = args?.entities;
resourceInputs["incrementalRefreshInterval"] = args?.incrementalRefreshInterval;
resourceInputs["incrementalSyncDisabled"] = args?.incrementalSyncDisabled;
resourceInputs["jsonParams"] = args?.jsonParams;
resourceInputs["kmsKeyName"] = args?.kmsKeyName;
resourceInputs["location"] = args?.location;
resourceInputs["params"] = args?.params;
resourceInputs["project"] = args?.project;
resourceInputs["refreshInterval"] = args?.refreshInterval;
resourceInputs["staticIpEnabled"] = args?.staticIpEnabled;
resourceInputs["syncMode"] = args?.syncMode;
resourceInputs["actionState"] = undefined /*out*/;
resourceInputs["blockingReasons"] = undefined /*out*/;
resourceInputs["connectorType"] = undefined /*out*/;
resourceInputs["createTime"] = undefined /*out*/;
resourceInputs["errors"] = undefined /*out*/;
resourceInputs["lastSyncTime"] = undefined /*out*/;
resourceInputs["latestPauseTime"] = undefined /*out*/;
resourceInputs["name"] = undefined /*out*/;
resourceInputs["privateConnectivityProjectId"] = undefined /*out*/;
resourceInputs["realtimeState"] = undefined /*out*/;
resourceInputs["state"] = undefined /*out*/;
resourceInputs["staticIpAddresses"] = undefined /*out*/;
resourceInputs["updateTime"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(DataConnector.__pulumiType, name, resourceInputs, opts);
}
}
exports.DataConnector = DataConnector;
//# sourceMappingURL=dataConnector.js.map