"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.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",
 *     },
 * });
 * ```
 * ### Datastream Private Connection Psc Interface
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const defaultNetwork = new gcp.compute.Network("default", {
 *     name: "my-network",
 *     autoCreateSubnetworks: false,
 * });
 * const defaultSubnetwork = new gcp.compute.Subnetwork("default", {
 *     name: "my-subnetwork",
 *     region: "us-central1",
 *     network: defaultNetwork.id,
 *     ipCidrRange: "10.0.0.0/16",
 * });
 * const defaultNetworkAttachment = new gcp.compute.NetworkAttachment("default", {
 *     name: "my-network-attachment",
 *     region: "us-central1",
 *     description: "basic network attachment description",
 *     connectionPreference: "ACCEPT_AUTOMATIC",
 *     subnetworks: [defaultSubnetwork.selfLink],
 * });
 * const _default = new gcp.datastream.PrivateConnection("default", {
 *     displayName: "Connection profile",
 *     location: "us-central1",
 *     privateConnectionId: "my-connection",
 *     labels: {
 *         key: "value",
 *     },
 *     pscInterfaceConfig: {
 *         networkAttachment: defaultNetworkAttachment.id,
 *     },
 * });
 * ```
 *
 * ## 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, { ...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?.createWithoutValidation;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["effectiveLabels"] = state?.effectiveLabels;
            resourceInputs["errors"] = state?.errors;
            resourceInputs["labels"] = state?.labels;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["privateConnectionId"] = state?.privateConnectionId;
            resourceInputs["project"] = state?.project;
            resourceInputs["pscInterfaceConfig"] = state?.pscInterfaceConfig;
            resourceInputs["pulumiLabels"] = state?.pulumiLabels;
            resourceInputs["state"] = state?.state;
            resourceInputs["vpcPeeringConfig"] = state?.vpcPeeringConfig;
        }
        else {
            const args = argsOrState;
            if (args?.displayName === undefined && !opts.urn) {
                throw new Error("Missing required property 'displayName'");
            }
            if (args?.location === undefined && !opts.urn) {
                throw new Error("Missing required property 'location'");
            }
            if (args?.privateConnectionId === undefined && !opts.urn) {
                throw new Error("Missing required property 'privateConnectionId'");
            }
            resourceInputs["createWithoutValidation"] = args?.createWithoutValidation;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["labels"] = args?.labels;
            resourceInputs["location"] = args?.location;
            resourceInputs["privateConnectionId"] = args?.privateConnectionId;
            resourceInputs["project"] = args?.project;
            resourceInputs["pscInterfaceConfig"] = args?.pscInterfaceConfig;
            resourceInputs["vpcPeeringConfig"] = args?.vpcPeeringConfig;
            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