"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.MembershipRbacRoleBinding = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * RBACRoleBinding represents a rbacrolebinding across the Fleet.
 *
 * To get more information about MembershipRBACRoleBinding, see:
 *
 * * [API documentation](https://cloud.google.com/anthos/fleet-management/docs/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 Rbac Role Binding 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: "tf-test-membership_1443",
 *     endpoint: {
 *         gkeCluster: {
 *             resourceLink: pulumi.interpolate`//container.googleapis.com/${primary.id}`,
 *         },
 *     },
 * }, {
 *     dependsOn: [primary],
 * });
 * const project = gcp.organizations.getProject({});
 * const membershipRbacRoleBinding = new gcp.gkehub.MembershipRbacRoleBinding("membership_rbac_role_binding", {
 *     membershipRbacRoleBindingId: "tf-test-membership-rbac-role-binding_26032",
 *     membershipId: membership.membershipId,
 *     user: project.then(project => `service-${project.number}@gcp-sa-anthossupport.iam.gserviceaccount.com`),
 *     role: {
 *         predefinedRole: "ANTHOS_SUPPORT",
 *     },
 *     location: "global",
 * }, {
 *     dependsOn: [membership],
 * });
 * ```
 *
 * ## Import
 *
 * MembershipRBACRoleBinding can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{location}}/memberships/{{membership_id}}/rbacrolebindings/{{membership_rbac_role_binding_id}}`
 *
 * * `{{project}}/{{location}}/{{membership_id}}/{{membership_rbac_role_binding_id}}`
 *
 * * `{{location}}/{{membership_id}}/{{membership_rbac_role_binding_id}}`
 *
 * When using the `pulumi import` command, MembershipRBACRoleBinding can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:gkehub/membershipRbacRoleBinding:MembershipRbacRoleBinding default projects/{{project}}/locations/{{location}}/memberships/{{membership_id}}/rbacrolebindings/{{membership_rbac_role_binding_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:gkehub/membershipRbacRoleBinding:MembershipRbacRoleBinding default {{project}}/{{location}}/{{membership_id}}/{{membership_rbac_role_binding_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:gkehub/membershipRbacRoleBinding:MembershipRbacRoleBinding default {{location}}/{{membership_id}}/{{membership_rbac_role_binding_id}}
 * ```
 */
class MembershipRbacRoleBinding extends pulumi.CustomResource {
    /**
     * Get an existing MembershipRbacRoleBinding 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 MembershipRbacRoleBinding(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of MembershipRbacRoleBinding.  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'] === MembershipRbacRoleBinding.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["deleteTime"] = state?.deleteTime;
            resourceInputs["location"] = state?.location;
            resourceInputs["membershipId"] = state?.membershipId;
            resourceInputs["membershipRbacRoleBindingId"] = state?.membershipRbacRoleBindingId;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["role"] = state?.role;
            resourceInputs["states"] = state?.states;
            resourceInputs["uid"] = state?.uid;
            resourceInputs["updateTime"] = state?.updateTime;
            resourceInputs["user"] = state?.user;
        }
        else {
            const args = argsOrState;
            if (args?.location === undefined && !opts.urn) {
                throw new Error("Missing required property 'location'");
            }
            if (args?.membershipId === undefined && !opts.urn) {
                throw new Error("Missing required property 'membershipId'");
            }
            if (args?.membershipRbacRoleBindingId === undefined && !opts.urn) {
                throw new Error("Missing required property 'membershipRbacRoleBindingId'");
            }
            if (args?.role === undefined && !opts.urn) {
                throw new Error("Missing required property 'role'");
            }
            if (args?.user === undefined && !opts.urn) {
                throw new Error("Missing required property 'user'");
            }
            resourceInputs["location"] = args?.location;
            resourceInputs["membershipId"] = args?.membershipId;
            resourceInputs["membershipRbacRoleBindingId"] = args?.membershipRbacRoleBindingId;
            resourceInputs["project"] = args?.project;
            resourceInputs["role"] = args?.role;
            resourceInputs["user"] = args?.user;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["deleteTime"] = undefined /*out*/;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["states"] = undefined /*out*/;
            resourceInputs["uid"] = undefined /*out*/;
            resourceInputs["updateTime"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(MembershipRbacRoleBinding.__pulumiType, name, resourceInputs, opts);
    }
}
exports.MembershipRbacRoleBinding = MembershipRbacRoleBinding;
/** @internal */
MembershipRbacRoleBinding.__pulumiType = 'gcp:gkehub/membershipRbacRoleBinding:MembershipRbacRoleBinding';
//# sourceMappingURL=membershipRbacRoleBinding.js.map