"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.UserWorkloadsConfigMap = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * User workloads ConfigMap used by Airflow tasks that run with Kubernetes Executor or KubernetesPodOperator.
 * Intended for Composer 3 Environments.
 *
 * To get more information about UserWorkloadsConfigMap, see:
 *
 * * [API documentation](https://cloud.google.com/composer/docs/reference/rest/v1/projects.locations.environments.userWorkloadsConfigMaps)
 *
 * ## Example Usage
 *
 * ### Composer User Workloads Config Map Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const project = gcp.organizations.getProject({});
 * const test = new gcp.serviceaccount.Account("test", {
 *     accountId: "test-sa",
 *     displayName: "Test Service Account for Composer Environment",
 * });
 * const composer_worker = new gcp.projects.IAMMember("composer-worker", {
 *     project: project.then(project => project.projectId),
 *     role: "roles/composer.worker",
 *     member: pulumi.interpolate`serviceAccount:${test.email}`,
 * });
 * const environment = new gcp.composer.Environment("environment", {
 *     name: "test-environment",
 *     region: "us-central1",
 *     config: {
 *         softwareConfig: {
 *             imageVersion: "composer-3-airflow-2",
 *         },
 *         nodeConfig: {
 *             serviceAccount: test.name,
 *         },
 *     },
 * }, {
 *     dependsOn: [composer_worker],
 * });
 * const configMap = new gcp.composer.UserWorkloadsConfigMap("config_map", {
 *     name: "test-config-map",
 *     region: "us-central1",
 *     environment: environment.name,
 *     data: {
 *         api_host: "apihost:443",
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * UserWorkloadsConfigMap can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{region}}/environments/{{environment}}/userWorkloadsConfigMaps/{{name}}`
 *
 * * `{{project}}/{{region}}/{{environment}}/{{name}}`
 *
 * * `{{region}}/{{environment}}/{{name}}`
 *
 * * `{{environment}}/{{name}}`
 *
 * When using the `pulumi import` command, UserWorkloadsConfigMap can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:composer/userWorkloadsConfigMap:UserWorkloadsConfigMap default projects/{{project}}/locations/{{region}}/environments/{{environment}}/userWorkloadsConfigMaps/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:composer/userWorkloadsConfigMap:UserWorkloadsConfigMap default {{project}}/{{region}}/{{environment}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:composer/userWorkloadsConfigMap:UserWorkloadsConfigMap default {{region}}/{{environment}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:composer/userWorkloadsConfigMap:UserWorkloadsConfigMap default {{environment}}/{{name}}
 * ```
 */
class UserWorkloadsConfigMap extends pulumi.CustomResource {
    /**
     * Get an existing UserWorkloadsConfigMap 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 UserWorkloadsConfigMap(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of UserWorkloadsConfigMap.  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'] === UserWorkloadsConfigMap.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["data"] = state?.data;
            resourceInputs["environment"] = state?.environment;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["region"] = state?.region;
        }
        else {
            const args = argsOrState;
            if (args?.environment === undefined && !opts.urn) {
                throw new Error("Missing required property 'environment'");
            }
            resourceInputs["data"] = args?.data;
            resourceInputs["environment"] = args?.environment;
            resourceInputs["name"] = args?.name;
            resourceInputs["project"] = args?.project;
            resourceInputs["region"] = args?.region;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(UserWorkloadsConfigMap.__pulumiType, name, resourceInputs, opts);
    }
}
exports.UserWorkloadsConfigMap = UserWorkloadsConfigMap;
/** @internal */
UserWorkloadsConfigMap.__pulumiType = 'gcp:composer/userWorkloadsConfigMap:UserWorkloadsConfigMap';
//# sourceMappingURL=userWorkloadsConfigMap.js.map