"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.ConnectCluster = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A Managed Service for Kafka Connect cluster.
 *
 * ## Example Usage
 *
 * ### Managedkafka Connect Cluster Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const project = gcp.organizations.getProject({});
 * const mkcSecondarySubnet = new gcp.compute.Subnetwork("mkc_secondary_subnet", {
 *     project: project.then(project => project.projectId),
 *     name: "my-secondary-subnetwork",
 *     ipCidrRange: "10.3.0.0/16",
 *     region: "us-central1",
 *     network: "default",
 * });
 * const cluster = new gcp.managedkafka.Cluster("cluster", {
 *     clusterId: "my-cluster",
 *     location: "us-central1",
 *     capacityConfig: {
 *         vcpuCount: "3",
 *         memoryBytes: "3221225472",
 *     },
 *     gcpConfig: {
 *         accessConfig: {
 *             networkConfigs: [{
 *                 subnet: project.then(project => `projects/${project.number}/regions/us-central1/subnetworks/default`),
 *             }],
 *         },
 *     },
 * });
 * const example = new gcp.managedkafka.ConnectCluster("example", {
 *     connectClusterId: "my-connect-cluster",
 *     kafkaCluster: pulumi.all([project, cluster.clusterId]).apply(([project, clusterId]) => `projects/${project.projectId}/locations/us-central1/clusters/${clusterId}`),
 *     location: "us-central1",
 *     capacityConfig: {
 *         vcpuCount: "12",
 *         memoryBytes: "21474836480",
 *     },
 *     gcpConfig: {
 *         accessConfig: {
 *             networkConfigs: [{
 *                 primarySubnet: project.then(project => `projects/${project.number}/regions/us-central1/subnetworks/default`),
 *                 additionalSubnets: [mkcSecondarySubnet.id],
 *                 dnsDomainNames: [Promise.all([cluster.clusterId, project]).then(([clusterId, project]) => `${clusterId}.us-central1.managedkafka.${project.projectId}.cloud.goog`)],
 *             }],
 *         },
 *     },
 *     labels: {
 *         key: "value",
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * ConnectCluster can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{location}}/connectClusters/{{connect_cluster_id}}`
 *
 * * `{{project}}/{{location}}/{{connect_cluster_id}}`
 *
 * * `{{location}}/{{connect_cluster_id}}`
 *
 * When using the `pulumi import` command, ConnectCluster can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:managedkafka/connectCluster:ConnectCluster default projects/{{project}}/locations/{{location}}/connectClusters/{{connect_cluster_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:managedkafka/connectCluster:ConnectCluster default {{project}}/{{location}}/{{connect_cluster_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:managedkafka/connectCluster:ConnectCluster default {{location}}/{{connect_cluster_id}}
 * ```
 */
class ConnectCluster extends pulumi.CustomResource {
    /**
     * Get an existing ConnectCluster 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 ConnectCluster(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of ConnectCluster.  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'] === ConnectCluster.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["capacityConfig"] = state?.capacityConfig;
            resourceInputs["connectClusterId"] = state?.connectClusterId;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["effectiveLabels"] = state?.effectiveLabels;
            resourceInputs["gcpConfig"] = state?.gcpConfig;
            resourceInputs["kafkaCluster"] = state?.kafkaCluster;
            resourceInputs["labels"] = state?.labels;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["pulumiLabels"] = state?.pulumiLabels;
            resourceInputs["state"] = state?.state;
            resourceInputs["updateTime"] = state?.updateTime;
        }
        else {
            const args = argsOrState;
            if (args?.capacityConfig === undefined && !opts.urn) {
                throw new Error("Missing required property 'capacityConfig'");
            }
            if (args?.connectClusterId === undefined && !opts.urn) {
                throw new Error("Missing required property 'connectClusterId'");
            }
            if (args?.gcpConfig === undefined && !opts.urn) {
                throw new Error("Missing required property 'gcpConfig'");
            }
            if (args?.kafkaCluster === undefined && !opts.urn) {
                throw new Error("Missing required property 'kafkaCluster'");
            }
            if (args?.location === undefined && !opts.urn) {
                throw new Error("Missing required property 'location'");
            }
            resourceInputs["capacityConfig"] = args?.capacityConfig;
            resourceInputs["connectClusterId"] = args?.connectClusterId;
            resourceInputs["gcpConfig"] = args?.gcpConfig;
            resourceInputs["kafkaCluster"] = args?.kafkaCluster;
            resourceInputs["labels"] = args?.labels;
            resourceInputs["location"] = args?.location;
            resourceInputs["project"] = args?.project;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["effectiveLabels"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["pulumiLabels"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
            resourceInputs["updateTime"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(ConnectCluster.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ConnectCluster = ConnectCluster;
/** @internal */
ConnectCluster.__pulumiType = 'gcp:managedkafka/connectCluster:ConnectCluster';
//# sourceMappingURL=connectCluster.js.map