"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.TargetPool = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Manages a Target Pool within GCE. This is a collection of instances used as
 * target of a network load balancer (Forwarding Rule). For more information see
 * [the official
 * documentation](https://cloud.google.com/compute/docs/load-balancing/network/target-pools)
 * and [API](https://cloud.google.com/compute/docs/reference/latest/targetPools).
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const defaultHttpHealthCheck = new gcp.compute.HttpHealthCheck("default", {
 *     name: "default",
 *     requestPath: "/",
 *     checkIntervalSec: 1,
 *     timeoutSec: 1,
 * });
 * const _default = new gcp.compute.TargetPool("default", {
 *     name: "instance-pool",
 *     instances: [
 *         "us-central1-a/myinstance1",
 *         "us-central1-b/myinstance2",
 *     ],
 *     healthChecks: defaultHttpHealthCheck.name,
 * });
 * ```
 *
 * ## Import
 *
 * Target pools can be imported using any of the following formats:
 *
 * * `projects/{{project}}/regions/{{region}}/targetPools/{{name}}`
 *
 * * `{{project}}/{{region}}/{{name}}`
 *
 * * `{{region}}/{{name}}`
 *
 * * `{{name}}`
 *
 * When using the `pulumi import` command, target pools can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:compute/targetPool:TargetPool default projects/{{project}}/regions/{{region}}/targetPools/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/targetPool:TargetPool default {{project}}/{{region}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/targetPool:TargetPool default {{region}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/targetPool:TargetPool default {{name}}
 * ```
 */
class TargetPool extends pulumi.CustomResource {
    /**
     * Get an existing TargetPool 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 TargetPool(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of TargetPool.  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'] === TargetPool.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["backupPool"] = state?.backupPool;
            resourceInputs["description"] = state?.description;
            resourceInputs["failoverRatio"] = state?.failoverRatio;
            resourceInputs["healthChecks"] = state?.healthChecks;
            resourceInputs["instances"] = state?.instances;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["region"] = state?.region;
            resourceInputs["securityPolicy"] = state?.securityPolicy;
            resourceInputs["selfLink"] = state?.selfLink;
            resourceInputs["sessionAffinity"] = state?.sessionAffinity;
        }
        else {
            const args = argsOrState;
            resourceInputs["backupPool"] = args?.backupPool;
            resourceInputs["description"] = args?.description;
            resourceInputs["failoverRatio"] = args?.failoverRatio;
            resourceInputs["healthChecks"] = args?.healthChecks;
            resourceInputs["instances"] = args?.instances;
            resourceInputs["name"] = args?.name;
            resourceInputs["project"] = args?.project;
            resourceInputs["region"] = args?.region;
            resourceInputs["securityPolicy"] = args?.securityPolicy;
            resourceInputs["sessionAffinity"] = args?.sessionAffinity;
            resourceInputs["selfLink"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(TargetPool.__pulumiType, name, resourceInputs, opts);
    }
}
exports.TargetPool = TargetPool;
/** @internal */
TargetPool.__pulumiType = 'gcp:compute/targetPool:TargetPool';
//# sourceMappingURL=targetPool.js.map