"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.Connector = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Serverless VPC Access connector resource.
 *
 * To get more information about Connector, see:
 *
 * * [API documentation](https://cloud.google.com/vpc/docs/reference/vpcaccess/rest/v1/projects.locations.connectors)
 * * How-to Guides
 *     * [Configuring Serverless VPC Access](https://cloud.google.com/vpc/docs/configure-serverless-vpc-access)
 *
 * ## Example Usage
 *
 * ### Vpc Access Connector
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const connector = new gcp.vpcaccess.Connector("connector", {
 *     name: "vpc-con",
 *     ipCidrRange: "10.8.0.0/28",
 *     network: "default",
 *     minInstances: 2,
 *     maxInstances: 3,
 * });
 * ```
 * ### Vpc Access Connector Shared Vpc
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const customTest = new gcp.compute.Subnetwork("custom_test", {
 *     name: "vpc-con",
 *     ipCidrRange: "10.2.0.0/28",
 *     region: "us-central1",
 *     network: "default",
 * });
 * const connector = new gcp.vpcaccess.Connector("connector", {
 *     name: "vpc-con",
 *     subnet: {
 *         name: customTest.name,
 *     },
 *     machineType: "e2-standard-4",
 *     minInstances: 2,
 *     maxInstances: 3,
 * });
 * ```
 *
 * ## Import
 *
 * Connector can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{region}}/connectors/{{name}}`
 *
 * * `{{project}}/{{region}}/{{name}}`
 *
 * * `{{region}}/{{name}}`
 *
 * * `{{name}}`
 *
 * When using the `pulumi import` command, Connector can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:vpcaccess/connector:Connector default projects/{{project}}/locations/{{region}}/connectors/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:vpcaccess/connector:Connector default {{project}}/{{region}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:vpcaccess/connector:Connector default {{region}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:vpcaccess/connector:Connector default {{name}}
 * ```
 */
class Connector extends pulumi.CustomResource {
    /**
     * Get an existing Connector 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 Connector(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of Connector.  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'] === Connector.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["connectedProjects"] = state?.connectedProjects;
            resourceInputs["ipCidrRange"] = state?.ipCidrRange;
            resourceInputs["machineType"] = state?.machineType;
            resourceInputs["maxInstances"] = state?.maxInstances;
            resourceInputs["maxThroughput"] = state?.maxThroughput;
            resourceInputs["minInstances"] = state?.minInstances;
            resourceInputs["minThroughput"] = state?.minThroughput;
            resourceInputs["name"] = state?.name;
            resourceInputs["network"] = state?.network;
            resourceInputs["project"] = state?.project;
            resourceInputs["region"] = state?.region;
            resourceInputs["selfLink"] = state?.selfLink;
            resourceInputs["state"] = state?.state;
            resourceInputs["subnet"] = state?.subnet;
        }
        else {
            const args = argsOrState;
            resourceInputs["ipCidrRange"] = args?.ipCidrRange;
            resourceInputs["machineType"] = args?.machineType;
            resourceInputs["maxInstances"] = args?.maxInstances;
            resourceInputs["maxThroughput"] = args?.maxThroughput;
            resourceInputs["minInstances"] = args?.minInstances;
            resourceInputs["minThroughput"] = args?.minThroughput;
            resourceInputs["name"] = args?.name;
            resourceInputs["network"] = args?.network;
            resourceInputs["project"] = args?.project;
            resourceInputs["region"] = args?.region;
            resourceInputs["subnet"] = args?.subnet;
            resourceInputs["connectedProjects"] = undefined /*out*/;
            resourceInputs["selfLink"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Connector.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Connector = Connector;
/** @internal */
Connector.__pulumiType = 'gcp:vpcaccess/connector:Connector';
//# sourceMappingURL=connector.js.map