"use strict";
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.Permission = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Provides a resource to manage vke permission
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as volcengine from "@pulumi/volcengine";
 * import * as volcengine from "@volcengine/pulumi";
 *
 * const fooZones = volcengine.ecs.getZones({});
 * // create vpc
 * const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
 *     vpcName: "acc-test-vpc",
 *     cidrBlock: "172.16.0.0/16",
 * });
 * // create subnet
 * const fooSubnet = new volcengine.vpc.Subnet("fooSubnet", {
 *     subnetName: "acc-test-subnet",
 *     cidrBlock: "172.16.0.0/24",
 *     zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
 *     vpcId: fooVpc.id,
 * });
 * // create security group
 * const fooSecurityGroup = new volcengine.vpc.SecurityGroup("fooSecurityGroup", {
 *     securityGroupName: "acc-test-security-group",
 *     vpcId: fooVpc.id,
 * });
 * // create vke cluster
 * const fooCluster = new volcengine.vke.Cluster("fooCluster", {
 *     description: "created by terraform",
 *     projectName: "default",
 *     deleteProtectionEnabled: false,
 *     clusterConfig: {
 *         subnetIds: [fooSubnet.id],
 *         apiServerPublicAccessEnabled: true,
 *         apiServerPublicAccessConfig: {
 *             publicAccessNetworkConfig: {
 *                 billingType: "PostPaidByBandwidth",
 *                 bandwidth: 1,
 *             },
 *         },
 *         resourcePublicAccessDefaultEnabled: true,
 *     },
 *     podsConfig: {
 *         podNetworkMode: "VpcCniShared",
 *         vpcCniConfig: {
 *             subnetIds: [fooSubnet.id],
 *         },
 *     },
 *     servicesConfig: {
 *         serviceCidrsv4s: ["172.30.0.0/18"],
 *     },
 *     tags: [{
 *         key: "tf-k1",
 *         value: "tf-v1",
 *     }],
 * });
 * const fooPermission = new volcengine.vke.Permission("fooPermission", {
 *     roleName: "vke:visitor",
 *     granteeId: 385500000,
 *     granteeType: "User",
 *     roleDomain: "cluster",
 *     clusterId: fooCluster.id,
 * });
 * ```
 *
 * ## Import
 *
 * VkePermission can be imported using the id, e.g.
 *
 * ```sh
 * $ pulumi import volcengine:vke/permission:Permission default resource_id
 * ```
 */
class Permission extends pulumi.CustomResource {
    /**
     * Get an existing Permission 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 Permission(name, state, Object.assign(Object.assign({}, opts), { id: id }));
    }
    /**
     * Returns true if the given object is an instance of Permission.  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'] === Permission.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["authorizedAt"] = state ? state.authorizedAt : undefined;
            resourceInputs["authorizerId"] = state ? state.authorizerId : undefined;
            resourceInputs["authorizerName"] = state ? state.authorizerName : undefined;
            resourceInputs["authorizerType"] = state ? state.authorizerType : undefined;
            resourceInputs["clusterId"] = state ? state.clusterId : undefined;
            resourceInputs["grantedAt"] = state ? state.grantedAt : undefined;
            resourceInputs["granteeId"] = state ? state.granteeId : undefined;
            resourceInputs["granteeType"] = state ? state.granteeType : undefined;
            resourceInputs["isCustomRole"] = state ? state.isCustomRole : undefined;
            resourceInputs["kubeRoleBindingName"] = state ? state.kubeRoleBindingName : undefined;
            resourceInputs["message"] = state ? state.message : undefined;
            resourceInputs["namespace"] = state ? state.namespace : undefined;
            resourceInputs["revokedAt"] = state ? state.revokedAt : undefined;
            resourceInputs["roleDomain"] = state ? state.roleDomain : undefined;
            resourceInputs["roleName"] = state ? state.roleName : undefined;
            resourceInputs["status"] = state ? state.status : undefined;
        }
        else {
            const args = argsOrState;
            if ((!args || args.granteeId === undefined) && !opts.urn) {
                throw new Error("Missing required property 'granteeId'");
            }
            if ((!args || args.granteeType === undefined) && !opts.urn) {
                throw new Error("Missing required property 'granteeType'");
            }
            if ((!args || args.roleDomain === undefined) && !opts.urn) {
                throw new Error("Missing required property 'roleDomain'");
            }
            if ((!args || args.roleName === undefined) && !opts.urn) {
                throw new Error("Missing required property 'roleName'");
            }
            resourceInputs["clusterId"] = args ? args.clusterId : undefined;
            resourceInputs["granteeId"] = args ? args.granteeId : undefined;
            resourceInputs["granteeType"] = args ? args.granteeType : undefined;
            resourceInputs["isCustomRole"] = args ? args.isCustomRole : undefined;
            resourceInputs["namespace"] = args ? args.namespace : undefined;
            resourceInputs["roleDomain"] = args ? args.roleDomain : undefined;
            resourceInputs["roleName"] = args ? args.roleName : undefined;
            resourceInputs["authorizedAt"] = undefined /*out*/;
            resourceInputs["authorizerId"] = undefined /*out*/;
            resourceInputs["authorizerName"] = undefined /*out*/;
            resourceInputs["authorizerType"] = undefined /*out*/;
            resourceInputs["grantedAt"] = undefined /*out*/;
            resourceInputs["kubeRoleBindingName"] = undefined /*out*/;
            resourceInputs["message"] = undefined /*out*/;
            resourceInputs["revokedAt"] = undefined /*out*/;
            resourceInputs["status"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Permission.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Permission = Permission;
/** @internal */
Permission.__pulumiType = 'volcengine:vke/permission:Permission';
//# sourceMappingURL=permission.js.map