UNPKG

@pulumi/gcp

Version:

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

141 lines 6.71 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.PrivateConnection = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * The PrivateConnection resource is used to establish private connectivity between Datastream and a customer's network. * * To get more information about PrivateConnection, see: * * * [API documentation](https://cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.privateConnections) * * How-to Guides * * [Official Documentation](https://cloud.google.com/datastream/docs/create-a-private-connectivity-configuration) * * ## Example Usage * * ### Datastream Private Connection Full * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const defaultNetwork = new gcp.compute.Network("default", {name: "my-network"}); * const _default = new gcp.datastream.PrivateConnection("default", { * displayName: "Connection profile", * location: "us-central1", * privateConnectionId: "my-connection", * labels: { * key: "value", * }, * vpcPeeringConfig: { * vpc: defaultNetwork.id, * subnet: "10.0.0.0/29", * }, * }); * ``` * * ## Import * * PrivateConnection can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/privateConnections/{{private_connection_id}}` * * * `{{project}}/{{location}}/{{private_connection_id}}` * * * `{{location}}/{{private_connection_id}}` * * When using the `pulumi import` command, PrivateConnection can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:datastream/privateConnection:PrivateConnection default projects/{{project}}/locations/{{location}}/privateConnections/{{private_connection_id}} * ``` * * ```sh * $ pulumi import gcp:datastream/privateConnection:PrivateConnection default {{project}}/{{location}}/{{private_connection_id}} * ``` * * ```sh * $ pulumi import gcp:datastream/privateConnection:PrivateConnection default {{location}}/{{private_connection_id}} * ``` */ class PrivateConnection extends pulumi.CustomResource { /** * Get an existing PrivateConnection 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 PrivateConnection(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of PrivateConnection. 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'] === PrivateConnection.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["createWithoutValidation"] = state ? state.createWithoutValidation : undefined; resourceInputs["displayName"] = state ? state.displayName : undefined; resourceInputs["effectiveLabels"] = state ? state.effectiveLabels : undefined; resourceInputs["errors"] = state ? state.errors : undefined; resourceInputs["labels"] = state ? state.labels : undefined; resourceInputs["location"] = state ? state.location : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["privateConnectionId"] = state ? state.privateConnectionId : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["pulumiLabels"] = state ? state.pulumiLabels : undefined; resourceInputs["state"] = state ? state.state : undefined; resourceInputs["vpcPeeringConfig"] = state ? state.vpcPeeringConfig : undefined; } else { const args = argsOrState; if ((!args || args.displayName === undefined) && !opts.urn) { throw new Error("Missing required property 'displayName'"); } if ((!args || args.location === undefined) && !opts.urn) { throw new Error("Missing required property 'location'"); } if ((!args || args.privateConnectionId === undefined) && !opts.urn) { throw new Error("Missing required property 'privateConnectionId'"); } if ((!args || args.vpcPeeringConfig === undefined) && !opts.urn) { throw new Error("Missing required property 'vpcPeeringConfig'"); } resourceInputs["createWithoutValidation"] = args ? args.createWithoutValidation : undefined; resourceInputs["displayName"] = args ? args.displayName : undefined; resourceInputs["labels"] = args ? args.labels : undefined; resourceInputs["location"] = args ? args.location : undefined; resourceInputs["privateConnectionId"] = args ? args.privateConnectionId : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["vpcPeeringConfig"] = args ? args.vpcPeeringConfig : undefined; resourceInputs["effectiveLabels"] = undefined /*out*/; resourceInputs["errors"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; resourceInputs["pulumiLabels"] = undefined /*out*/; resourceInputs["state"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(PrivateConnection.__pulumiType, name, resourceInputs, opts); } } exports.PrivateConnection = PrivateConnection; /** @internal */ PrivateConnection.__pulumiType = 'gcp:datastream/privateConnection:PrivateConnection'; //# sourceMappingURL=privateConnection.js.map