"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.WorkloadIdentityPool = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Represents a collection of external workload identities. You can define IAM policies to
 * grant these identities access to Google Cloud resources.
 *
 * To get more information about WorkloadIdentityPool, see:
 *
 * * [API documentation](https://cloud.google.com/iam/docs/reference/rest/v1/projects.locations.workloadIdentityPools)
 * * How-to Guides
 *     * [Configure managed workload identity authentication for Compute Engine](https://cloud.google.com/iam/docs/create-managed-workload-identities)
 *     * [Configure managed workload identity authentication for GKE](https://cloud.google.com/iam/docs/create-managed-workload-identities-gke)
 *     * [Managing workload identity pools](https://cloud.google.com/iam/docs/manage-workload-identity-pools-providers#pools)
 *
 * ## Example Usage
 *
 * ### Iam Workload Identity Pool Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const example = new gcp.iam.WorkloadIdentityPool("example", {workloadIdentityPoolId: "example-pool"});
 * ```
 * ### Iam Workload Identity Pool Full Federation Only Mode
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const example = new gcp.iam.WorkloadIdentityPool("example", {
 *     workloadIdentityPoolId: "example-pool",
 *     displayName: "Name of the pool",
 *     description: "Identity pool operates in FEDERATION_ONLY mode",
 *     disabled: true,
 *     mode: "FEDERATION_ONLY",
 * });
 * ```
 * ### Iam Workload Identity Pool Full Trust Domain Mode
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * import * as std from "@pulumi/std";
 *
 * const example = new gcp.iam.WorkloadIdentityPool("example", {
 *     workloadIdentityPoolId: "example-pool",
 *     displayName: "Name of the pool",
 *     description: "Identity pool operates in TRUST_DOMAIN mode",
 *     disabled: true,
 *     mode: "TRUST_DOMAIN",
 *     inlineCertificateIssuanceConfig: {
 *         caPools: {
 *             "us-central1": "projects/project-bar/locations/us-central1/caPools/ca-pool-bar",
 *             "asia-east2": "projects/project-foo/locations/asia-east2/caPools/ca-pool-foo",
 *         },
 *         lifetime: "86400s",
 *         rotationWindowPercentage: 50,
 *         keyAlgorithm: "ECDSA_P256",
 *     },
 *     inlineTrustConfig: {
 *         additionalTrustBundles: [
 *             {
 *                 trustDomain: "example.com",
 *                 trustAnchors: [
 *                     {
 *                         pemCertificate: std.file({
 *                             input: "test-fixtures/trust_anchor_1.pem",
 *                         }).then(invoke => invoke.result),
 *                     },
 *                     {
 *                         pemCertificate: std.file({
 *                             input: "test-fixtures/trust_anchor_2.pem",
 *                         }).then(invoke => invoke.result),
 *                     },
 *                 ],
 *             },
 *             {
 *                 trustDomain: "example.net",
 *                 trustAnchors: [
 *                     {
 *                         pemCertificate: std.file({
 *                             input: "test-fixtures/trust_anchor_3.pem",
 *                         }).then(invoke => invoke.result),
 *                     },
 *                     {
 *                         pemCertificate: std.file({
 *                             input: "test-fixtures/trust_anchor_4.pem",
 *                         }).then(invoke => invoke.result),
 *                     },
 *                 ],
 *             },
 *         ],
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * WorkloadIdentityPool can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/global/workloadIdentityPools/{{workload_identity_pool_id}}`
 *
 * * `{{project}}/{{workload_identity_pool_id}}`
 *
 * * `{{workload_identity_pool_id}}`
 *
 * When using the `pulumi import` command, WorkloadIdentityPool can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:iam/workloadIdentityPool:WorkloadIdentityPool default projects/{{project}}/locations/global/workloadIdentityPools/{{workload_identity_pool_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:iam/workloadIdentityPool:WorkloadIdentityPool default {{project}}/{{workload_identity_pool_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:iam/workloadIdentityPool:WorkloadIdentityPool default {{workload_identity_pool_id}}
 * ```
 */
class WorkloadIdentityPool extends pulumi.CustomResource {
    /**
     * Get an existing WorkloadIdentityPool 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 WorkloadIdentityPool(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of WorkloadIdentityPool.  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'] === WorkloadIdentityPool.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["description"] = state?.description;
            resourceInputs["disabled"] = state?.disabled;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["inlineCertificateIssuanceConfig"] = state?.inlineCertificateIssuanceConfig;
            resourceInputs["inlineTrustConfig"] = state?.inlineTrustConfig;
            resourceInputs["mode"] = state?.mode;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["state"] = state?.state;
            resourceInputs["workloadIdentityPoolId"] = state?.workloadIdentityPoolId;
        }
        else {
            const args = argsOrState;
            if (args?.workloadIdentityPoolId === undefined && !opts.urn) {
                throw new Error("Missing required property 'workloadIdentityPoolId'");
            }
            resourceInputs["description"] = args?.description;
            resourceInputs["disabled"] = args?.disabled;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["inlineCertificateIssuanceConfig"] = args?.inlineCertificateIssuanceConfig;
            resourceInputs["inlineTrustConfig"] = args?.inlineTrustConfig;
            resourceInputs["mode"] = args?.mode;
            resourceInputs["project"] = args?.project;
            resourceInputs["workloadIdentityPoolId"] = args?.workloadIdentityPoolId;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(WorkloadIdentityPool.__pulumiType, name, resourceInputs, opts);
    }
}
exports.WorkloadIdentityPool = WorkloadIdentityPool;
/** @internal */
WorkloadIdentityPool.__pulumiType = 'gcp:iam/workloadIdentityPool:WorkloadIdentityPool';
//# sourceMappingURL=workloadIdentityPool.js.map