"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.Membership = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Membership contains information about a member cluster.
 *
 * To get more information about Membership, see:
 *
 * * [API documentation](https://cloud.google.com/anthos/multicluster-management/reference/rest/v1/projects.locations.memberships)
 * * How-to Guides
 *     * [Registering a Cluster](https://cloud.google.com/anthos/multicluster-management/connect/registering-a-cluster#register_cluster)
 *
 * ## Example Usage
 *
 * ### Gkehub Membership Regional
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const primary = new gcp.container.Cluster("primary", {
 *     name: "basic-cluster",
 *     location: "us-central1-a",
 *     initialNodeCount: 1,
 *     deletionProtection: false,
 *     network: "default",
 *     subnetwork: "default",
 * });
 * const membership = new gcp.gkehub.Membership("membership", {
 *     membershipId: "basic",
 *     location: "us-west1",
 *     endpoint: {
 *         gkeCluster: {
 *             resourceLink: pulumi.interpolate`//container.googleapis.com/${primary.id}`,
 *         },
 *     },
 * });
 * ```
 * ### Gkehub Membership Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const primary = new gcp.container.Cluster("primary", {
 *     name: "basic-cluster",
 *     location: "us-central1-a",
 *     initialNodeCount: 1,
 *     deletionProtection: true,
 *     network: "default",
 *     subnetwork: "default",
 * });
 * const membership = new gcp.gkehub.Membership("membership", {
 *     membershipId: "basic",
 *     endpoint: {
 *         gkeCluster: {
 *             resourceLink: pulumi.interpolate`//container.googleapis.com/${primary.id}`,
 *         },
 *     },
 *     labels: {
 *         env: "test",
 *     },
 * });
 * ```
 * ### Gkehub Membership Issuer
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const primary = new gcp.container.Cluster("primary", {
 *     name: "basic-cluster",
 *     location: "us-central1-a",
 *     initialNodeCount: 1,
 *     workloadIdentityConfig: {
 *         workloadPool: "my-project-name.svc.id.goog",
 *     },
 *     deletionProtection: true,
 *     network: "default",
 *     subnetwork: "default",
 * });
 * const membership = new gcp.gkehub.Membership("membership", {
 *     membershipId: "basic",
 *     endpoint: {
 *         gkeCluster: {
 *             resourceLink: primary.id,
 *         },
 *     },
 *     authority: {
 *         issuer: pulumi.interpolate`https://container.googleapis.com/v1/${primary.id}`,
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * Membership can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{location}}/memberships/{{membership_id}}`
 *
 * * `{{project}}/{{location}}/{{membership_id}}`
 *
 * * `{{location}}/{{membership_id}}`
 *
 * When using the `pulumi import` command, Membership can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:gkehub/membership:Membership default projects/{{project}}/locations/{{location}}/memberships/{{membership_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:gkehub/membership:Membership default {{project}}/{{location}}/{{membership_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:gkehub/membership:Membership default {{location}}/{{membership_id}}
 * ```
 */
class Membership extends pulumi.CustomResource {
    /**
     * Get an existing Membership 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 Membership(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of Membership.  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'] === Membership.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["authority"] = state?.authority;
            resourceInputs["effectiveLabels"] = state?.effectiveLabels;
            resourceInputs["endpoint"] = state?.endpoint;
            resourceInputs["labels"] = state?.labels;
            resourceInputs["location"] = state?.location;
            resourceInputs["membershipId"] = state?.membershipId;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["pulumiLabels"] = state?.pulumiLabels;
        }
        else {
            const args = argsOrState;
            if (args?.membershipId === undefined && !opts.urn) {
                throw new Error("Missing required property 'membershipId'");
            }
            resourceInputs["authority"] = args?.authority;
            resourceInputs["endpoint"] = args?.endpoint;
            resourceInputs["labels"] = args?.labels;
            resourceInputs["location"] = args?.location;
            resourceInputs["membershipId"] = args?.membershipId;
            resourceInputs["project"] = args?.project;
            resourceInputs["effectiveLabels"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["pulumiLabels"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(Membership.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Membership = Membership;
/** @internal */
Membership.__pulumiType = 'gcp:gkehub/membership:Membership';
//# sourceMappingURL=membership.js.map