UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

410 lines • 15.8 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.Connection = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * An Integration connectors Connection. * * To get more information about Connection, see: * * * [API documentation](https://cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.connections) * * How-to Guides * * [Official Documentation](https://cloud.google.com/integration-connectors/docs/createconnection) * * ## Example Usage * * ### Integration Connectors Connection Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const testProject = gcp.organizations.getProject({}); * const pubsubconnection = new gcp.integrationconnectors.Connection("pubsubconnection", { * name: "test-pubsub", * location: "us-central1", * connectorVersion: testProject.then(testProject => `projects/${testProject.projectId}/locations/global/providers/gcp/connectors/pubsub/versions/1`), * description: "tf created description", * configVariables: [ * { * key: "project_id", * stringValue: "connectors-example", * }, * { * key: "topic_id", * stringValue: "test", * }, * ], * }); * ``` * ### Integration Connectors Connection Advanced * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const testProject = gcp.organizations.getProject({}); * const secret_basic = new gcp.secretmanager.Secret("secret-basic", { * secretId: "test-secret", * replication: { * userManaged: { * replicas: [{ * location: "us-central1", * }], * }, * }, * }); * const secret_version_basic = new gcp.secretmanager.SecretVersion("secret-version-basic", { * secret: secret_basic.id, * secretData: "dummypassword", * }); * const secretIam = new gcp.secretmanager.SecretIamMember("secret_iam", { * secretId: secret_basic.id, * role: "roles/secretmanager.admin", * member: testProject.then(testProject => `serviceAccount:${testProject.number}-compute@developer.gserviceaccount.com`), * }, { * dependsOn: [secret_version_basic], * }); * const zendeskconnection = new gcp.integrationconnectors.Connection("zendeskconnection", { * name: "test-zendesk", * description: "tf updated description", * location: "us-central1", * serviceAccount: testProject.then(testProject => `${testProject.number}-compute@developer.gserviceaccount.com`), * connectorVersion: testProject.then(testProject => `projects/${testProject.projectId}/locations/global/providers/zendesk/connectors/zendesk/versions/1`), * configVariables: [ * { * key: "proxy_enabled", * booleanValue: false, * }, * { * key: "sample_integer_value", * integerValue: 1, * }, * { * key: "sample_encryption_key_value", * encryptionKeyValue: { * type: "GOOGLE_MANAGED", * kmsKeyName: "sampleKMSKkey", * }, * }, * { * key: "sample_secret_value", * secretValue: { * secretVersion: secret_version_basic.name, * }, * }, * ], * suspended: false, * authConfig: { * additionalVariables: [ * { * key: "sample_string", * stringValue: "sampleString", * }, * { * key: "sample_boolean", * booleanValue: false, * }, * { * key: "sample_integer", * integerValue: 1, * }, * { * key: "sample_secret_value", * secretValue: { * secretVersion: secret_version_basic.name, * }, * }, * { * key: "sample_encryption_key_value", * encryptionKeyValue: { * type: "GOOGLE_MANAGED", * kmsKeyName: "sampleKMSKkey", * }, * }, * ], * authType: "USER_PASSWORD", * authKey: "sampleAuthKey", * userPassword: { * username: "user@xyz.com", * password: { * secretVersion: secret_version_basic.name, * }, * }, * }, * destinationConfigs: [{ * key: "url", * destinations: [{ * host: "https://test.zendesk.com", * port: 80, * }], * }], * lockConfig: { * locked: false, * reason: "Its not locked", * }, * logConfig: { * enabled: true, * }, * nodeConfig: { * minNodeCount: 2, * maxNodeCount: 50, * }, * labels: { * foo: "bar", * }, * sslConfig: { * additionalVariables: [ * { * key: "sample_string", * stringValue: "sampleString", * }, * { * key: "sample_boolean", * booleanValue: false, * }, * { * key: "sample_integer", * integerValue: 1, * }, * { * key: "sample_secret_value", * secretValue: { * secretVersion: secret_version_basic.name, * }, * }, * { * key: "sample_encryption_key_value", * encryptionKeyValue: { * type: "GOOGLE_MANAGED", * kmsKeyName: "sampleKMSKkey", * }, * }, * ], * clientCertType: "PEM", * clientCertificate: { * secretVersion: secret_version_basic.name, * }, * clientPrivateKey: { * secretVersion: secret_version_basic.name, * }, * clientPrivateKeyPass: { * secretVersion: secret_version_basic.name, * }, * privateServerCertificate: { * secretVersion: secret_version_basic.name, * }, * serverCertType: "PEM", * trustModel: "PRIVATE", * type: "TLS", * useSsl: true, * }, * eventingEnablementType: "EVENTING_AND_CONNECTION", * eventingConfig: { * additionalVariables: [ * { * key: "sample_string", * stringValue: "sampleString", * }, * { * key: "sample_boolean", * booleanValue: false, * }, * { * key: "sample_integer", * integerValue: 1, * }, * { * key: "sample_secret_value", * secretValue: { * secretVersion: secret_version_basic.name, * }, * }, * { * key: "sample_encryption_key_value", * encryptionKeyValue: { * type: "GOOGLE_MANAGED", * kmsKeyName: "sampleKMSKkey", * }, * }, * ], * registrationDestinationConfig: { * key: "registration_destination_config", * destinations: [{ * host: "https://test.zendesk.com", * port: 80, * }], * }, * authConfig: { * authType: "USER_PASSWORD", * authKey: "sampleAuthKey", * userPassword: { * username: "user@xyz.com", * password: { * secretVersion: secret_version_basic.name, * }, * }, * additionalVariables: [ * { * key: "sample_string", * stringValue: "sampleString", * }, * { * key: "sample_boolean", * booleanValue: false, * }, * { * key: "sample_integer", * integerValue: 1, * }, * { * key: "sample_secret_value", * secretValue: { * secretVersion: secret_version_basic.name, * }, * }, * { * key: "sample_encryption_key_value", * encryptionKeyValue: { * type: "GOOGLE_MANAGED", * kmsKeyName: "sampleKMSKkey", * }, * }, * ], * }, * enrichmentEnabled: true, * }, * }); * ``` * * ## Import * * Connection can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/connections/{{name}}` * * * `{{project}}/{{location}}/{{name}}` * * * `{{location}}/{{name}}` * * When using the `pulumi import` command, Connection can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:integrationconnectors/connection:Connection default projects/{{project}}/locations/{{location}}/connections/{{name}} * ``` * * ```sh * $ pulumi import gcp:integrationconnectors/connection:Connection default {{project}}/{{location}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:integrationconnectors/connection:Connection default {{location}}/{{name}} * ``` */ class Connection extends pulumi.CustomResource { /** * Get an existing Connection 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 Connection(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Connection. 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'] === Connection.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["authConfig"] = state?.authConfig; resourceInputs["configVariables"] = state?.configVariables; resourceInputs["connectionRevision"] = state?.connectionRevision; resourceInputs["connectorVersion"] = state?.connectorVersion; resourceInputs["connectorVersionInfraConfigs"] = state?.connectorVersionInfraConfigs; resourceInputs["connectorVersionLaunchStage"] = state?.connectorVersionLaunchStage; resourceInputs["createTime"] = state?.createTime; resourceInputs["description"] = state?.description; resourceInputs["destinationConfigs"] = state?.destinationConfigs; resourceInputs["effectiveLabels"] = state?.effectiveLabels; resourceInputs["eventingConfig"] = state?.eventingConfig; resourceInputs["eventingEnablementType"] = state?.eventingEnablementType; resourceInputs["eventingRuntimeDatas"] = state?.eventingRuntimeDatas; resourceInputs["labels"] = state?.labels; resourceInputs["location"] = state?.location; resourceInputs["lockConfig"] = state?.lockConfig; resourceInputs["logConfig"] = state?.logConfig; resourceInputs["name"] = state?.name; resourceInputs["nodeConfig"] = state?.nodeConfig; resourceInputs["project"] = state?.project; resourceInputs["pulumiLabels"] = state?.pulumiLabels; resourceInputs["serviceAccount"] = state?.serviceAccount; resourceInputs["serviceDirectory"] = state?.serviceDirectory; resourceInputs["sslConfig"] = state?.sslConfig; resourceInputs["statuses"] = state?.statuses; resourceInputs["subscriptionType"] = state?.subscriptionType; resourceInputs["suspended"] = state?.suspended; resourceInputs["updateTime"] = state?.updateTime; } else { const args = argsOrState; if (args?.connectorVersion === undefined && !opts.urn) { throw new Error("Missing required property 'connectorVersion'"); } if (args?.location === undefined && !opts.urn) { throw new Error("Missing required property 'location'"); } resourceInputs["authConfig"] = args?.authConfig; resourceInputs["configVariables"] = args?.configVariables; resourceInputs["connectorVersion"] = args?.connectorVersion; resourceInputs["description"] = args?.description; resourceInputs["destinationConfigs"] = args?.destinationConfigs; resourceInputs["eventingConfig"] = args?.eventingConfig; resourceInputs["eventingEnablementType"] = args?.eventingEnablementType; resourceInputs["labels"] = args?.labels; resourceInputs["location"] = args?.location; resourceInputs["lockConfig"] = args?.lockConfig; resourceInputs["logConfig"] = args?.logConfig; resourceInputs["name"] = args?.name; resourceInputs["nodeConfig"] = args?.nodeConfig; resourceInputs["project"] = args?.project; resourceInputs["serviceAccount"] = args?.serviceAccount; resourceInputs["sslConfig"] = args?.sslConfig; resourceInputs["suspended"] = args?.suspended; resourceInputs["connectionRevision"] = undefined /*out*/; resourceInputs["connectorVersionInfraConfigs"] = undefined /*out*/; resourceInputs["connectorVersionLaunchStage"] = undefined /*out*/; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["effectiveLabels"] = undefined /*out*/; resourceInputs["eventingRuntimeDatas"] = undefined /*out*/; resourceInputs["pulumiLabels"] = undefined /*out*/; resourceInputs["serviceDirectory"] = undefined /*out*/; resourceInputs["statuses"] = undefined /*out*/; resourceInputs["subscriptionType"] = undefined /*out*/; resourceInputs["updateTime"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(Connection.__pulumiType, name, resourceInputs, opts); } } exports.Connection = Connection; /** @internal */ Connection.__pulumiType = 'gcp:integrationconnectors/connection:Connection'; //# sourceMappingURL=connection.js.map