1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. cs
  5. KubernetesPermission
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.cs.KubernetesPermission

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    This resource will help you implement RBAC authorization for the kubernetes cluster, see What is kubernetes permissions.

    NOTE: Please make sure that the target RAM user has been granted a RAM policy with at least read-only permission of the target cluster in the RAM console. Otherwise, the ErrorRamPolicyConfig error will be returned. For more information about how to authorize a RAM user by attaching RAM policies, see Create a custom RAM policy.

    NOTE: If you call this operation as a RAM user, make sure that this RAM user has the permissions to grant other RAM users the permissions to manage ACK clusters. Otherwise, the StatusForbidden or ForbiddenGrantPermissions errors will be returned. For more information, see Use a RAM user to grant RBAC permissions to other RAM users.

    NOTE: This operation overwrites the permissions that have been granted to the specified RAM user. When you call this operation, make sure that the required permissions are included.

    NOTE: Available since v1.122.0.

    Create KubernetesPermission Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new KubernetesPermission(name: string, args: KubernetesPermissionArgs, opts?: CustomResourceOptions);
    @overload
    def KubernetesPermission(resource_name: str,
                             args: KubernetesPermissionArgs,
                             opts: Optional[ResourceOptions] = None)
    
    @overload
    def KubernetesPermission(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             uid: Optional[str] = None,
                             permissions: Optional[Sequence[KubernetesPermissionPermissionArgs]] = None)
    func NewKubernetesPermission(ctx *Context, name string, args KubernetesPermissionArgs, opts ...ResourceOption) (*KubernetesPermission, error)
    public KubernetesPermission(string name, KubernetesPermissionArgs args, CustomResourceOptions? opts = null)
    public KubernetesPermission(String name, KubernetesPermissionArgs args)
    public KubernetesPermission(String name, KubernetesPermissionArgs args, CustomResourceOptions options)
    
    type: alicloud:cs:KubernetesPermission
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args KubernetesPermissionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args KubernetesPermissionArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args KubernetesPermissionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args KubernetesPermissionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args KubernetesPermissionArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var kubernetesPermissionResource = new AliCloud.CS.KubernetesPermission("kubernetesPermissionResource", new()
    {
        Uid = "string",
        Permissions = new[]
        {
            new AliCloud.CS.Inputs.KubernetesPermissionPermissionArgs
            {
                Cluster = "string",
                RoleName = "string",
                RoleType = "string",
                IsCustom = false,
                IsRamRole = false,
                Namespace = "string",
            },
        },
    });
    
    example, err := cs.NewKubernetesPermission(ctx, "kubernetesPermissionResource", &cs.KubernetesPermissionArgs{
    	Uid: pulumi.String("string"),
    	Permissions: cs.KubernetesPermissionPermissionArray{
    		&cs.KubernetesPermissionPermissionArgs{
    			Cluster:   pulumi.String("string"),
    			RoleName:  pulumi.String("string"),
    			RoleType:  pulumi.String("string"),
    			IsCustom:  pulumi.Bool(false),
    			IsRamRole: pulumi.Bool(false),
    			Namespace: pulumi.String("string"),
    		},
    	},
    })
    
    var kubernetesPermissionResource = new KubernetesPermission("kubernetesPermissionResource", KubernetesPermissionArgs.builder()
        .uid("string")
        .permissions(KubernetesPermissionPermissionArgs.builder()
            .cluster("string")
            .roleName("string")
            .roleType("string")
            .isCustom(false)
            .isRamRole(false)
            .namespace("string")
            .build())
        .build());
    
    kubernetes_permission_resource = alicloud.cs.KubernetesPermission("kubernetesPermissionResource",
        uid="string",
        permissions=[{
            "cluster": "string",
            "role_name": "string",
            "role_type": "string",
            "is_custom": False,
            "is_ram_role": False,
            "namespace": "string",
        }])
    
    const kubernetesPermissionResource = new alicloud.cs.KubernetesPermission("kubernetesPermissionResource", {
        uid: "string",
        permissions: [{
            cluster: "string",
            roleName: "string",
            roleType: "string",
            isCustom: false,
            isRamRole: false,
            namespace: "string",
        }],
    });
    
    type: alicloud:cs:KubernetesPermission
    properties:
        permissions:
            - cluster: string
              isCustom: false
              isRamRole: false
              namespace: string
              roleName: string
              roleType: string
        uid: string
    

    KubernetesPermission Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The KubernetesPermission resource accepts the following input properties:

    Uid string
    The ID of the Ram user, and it can also be the id of the Ram Role. If you use Ram Role id, you need to set is_ram_role to true during authorization.
    Permissions List<Pulumi.AliCloud.CS.Inputs.KubernetesPermissionPermission>
    A list of user permission. See permissions below.
    Uid string
    The ID of the Ram user, and it can also be the id of the Ram Role. If you use Ram Role id, you need to set is_ram_role to true during authorization.
    Permissions []KubernetesPermissionPermissionArgs
    A list of user permission. See permissions below.
    uid String
    The ID of the Ram user, and it can also be the id of the Ram Role. If you use Ram Role id, you need to set is_ram_role to true during authorization.
    permissions List<KubernetesPermissionPermission>
    A list of user permission. See permissions below.
    uid string
    The ID of the Ram user, and it can also be the id of the Ram Role. If you use Ram Role id, you need to set is_ram_role to true during authorization.
    permissions KubernetesPermissionPermission[]
    A list of user permission. See permissions below.
    uid str
    The ID of the Ram user, and it can also be the id of the Ram Role. If you use Ram Role id, you need to set is_ram_role to true during authorization.
    permissions Sequence[KubernetesPermissionPermissionArgs]
    A list of user permission. See permissions below.
    uid String
    The ID of the Ram user, and it can also be the id of the Ram Role. If you use Ram Role id, you need to set is_ram_role to true during authorization.
    permissions List<Property Map>
    A list of user permission. See permissions below.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the KubernetesPermission resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing KubernetesPermission Resource

    Get an existing KubernetesPermission resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: KubernetesPermissionState, opts?: CustomResourceOptions): KubernetesPermission
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            permissions: Optional[Sequence[KubernetesPermissionPermissionArgs]] = None,
            uid: Optional[str] = None) -> KubernetesPermission
    func GetKubernetesPermission(ctx *Context, name string, id IDInput, state *KubernetesPermissionState, opts ...ResourceOption) (*KubernetesPermission, error)
    public static KubernetesPermission Get(string name, Input<string> id, KubernetesPermissionState? state, CustomResourceOptions? opts = null)
    public static KubernetesPermission get(String name, Output<String> id, KubernetesPermissionState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Permissions List<Pulumi.AliCloud.CS.Inputs.KubernetesPermissionPermission>
    A list of user permission. See permissions below.
    Uid string
    The ID of the Ram user, and it can also be the id of the Ram Role. If you use Ram Role id, you need to set is_ram_role to true during authorization.
    Permissions []KubernetesPermissionPermissionArgs
    A list of user permission. See permissions below.
    Uid string
    The ID of the Ram user, and it can also be the id of the Ram Role. If you use Ram Role id, you need to set is_ram_role to true during authorization.
    permissions List<KubernetesPermissionPermission>
    A list of user permission. See permissions below.
    uid String
    The ID of the Ram user, and it can also be the id of the Ram Role. If you use Ram Role id, you need to set is_ram_role to true during authorization.
    permissions KubernetesPermissionPermission[]
    A list of user permission. See permissions below.
    uid string
    The ID of the Ram user, and it can also be the id of the Ram Role. If you use Ram Role id, you need to set is_ram_role to true during authorization.
    permissions Sequence[KubernetesPermissionPermissionArgs]
    A list of user permission. See permissions below.
    uid str
    The ID of the Ram user, and it can also be the id of the Ram Role. If you use Ram Role id, you need to set is_ram_role to true during authorization.
    permissions List<Property Map>
    A list of user permission. See permissions below.
    uid String
    The ID of the Ram user, and it can also be the id of the Ram Role. If you use Ram Role id, you need to set is_ram_role to true during authorization.

    Supporting Types

    KubernetesPermissionPermission, KubernetesPermissionPermissionArgs

    Cluster string
    The ID of the cluster that you want to manage, When role_type value is all-clusters, the value of cluster must be "".
    RoleName string
    Specifies the predefined role that you want to assign. Valid values admin, ops, dev, restricted and the custom cluster roles.
    RoleType string
    The authorization type. Valid values cluster, namespace and all-clusters.
    IsCustom bool
    Specifies whether to perform a custom authorization. To perform a custom authorization, the value of is_custom must be true, and set role_name to a custom cluster role.
    IsRamRole bool
    Specifies whether the permissions are granted to a RAM role. When uid is ram role id, the value of is_ram_role must be true.
    Namespace string
    The namespace to which the permissions are scoped. This parameter is required only if you set role_type to namespace.
    Cluster string
    The ID of the cluster that you want to manage, When role_type value is all-clusters, the value of cluster must be "".
    RoleName string
    Specifies the predefined role that you want to assign. Valid values admin, ops, dev, restricted and the custom cluster roles.
    RoleType string
    The authorization type. Valid values cluster, namespace and all-clusters.
    IsCustom bool
    Specifies whether to perform a custom authorization. To perform a custom authorization, the value of is_custom must be true, and set role_name to a custom cluster role.
    IsRamRole bool
    Specifies whether the permissions are granted to a RAM role. When uid is ram role id, the value of is_ram_role must be true.
    Namespace string
    The namespace to which the permissions are scoped. This parameter is required only if you set role_type to namespace.
    cluster String
    The ID of the cluster that you want to manage, When role_type value is all-clusters, the value of cluster must be "".
    roleName String
    Specifies the predefined role that you want to assign. Valid values admin, ops, dev, restricted and the custom cluster roles.
    roleType String
    The authorization type. Valid values cluster, namespace and all-clusters.
    isCustom Boolean
    Specifies whether to perform a custom authorization. To perform a custom authorization, the value of is_custom must be true, and set role_name to a custom cluster role.
    isRamRole Boolean
    Specifies whether the permissions are granted to a RAM role. When uid is ram role id, the value of is_ram_role must be true.
    namespace String
    The namespace to which the permissions are scoped. This parameter is required only if you set role_type to namespace.
    cluster string
    The ID of the cluster that you want to manage, When role_type value is all-clusters, the value of cluster must be "".
    roleName string
    Specifies the predefined role that you want to assign. Valid values admin, ops, dev, restricted and the custom cluster roles.
    roleType string
    The authorization type. Valid values cluster, namespace and all-clusters.
    isCustom boolean
    Specifies whether to perform a custom authorization. To perform a custom authorization, the value of is_custom must be true, and set role_name to a custom cluster role.
    isRamRole boolean
    Specifies whether the permissions are granted to a RAM role. When uid is ram role id, the value of is_ram_role must be true.
    namespace string
    The namespace to which the permissions are scoped. This parameter is required only if you set role_type to namespace.
    cluster str
    The ID of the cluster that you want to manage, When role_type value is all-clusters, the value of cluster must be "".
    role_name str
    Specifies the predefined role that you want to assign. Valid values admin, ops, dev, restricted and the custom cluster roles.
    role_type str
    The authorization type. Valid values cluster, namespace and all-clusters.
    is_custom bool
    Specifies whether to perform a custom authorization. To perform a custom authorization, the value of is_custom must be true, and set role_name to a custom cluster role.
    is_ram_role bool
    Specifies whether the permissions are granted to a RAM role. When uid is ram role id, the value of is_ram_role must be true.
    namespace str
    The namespace to which the permissions are scoped. This parameter is required only if you set role_type to namespace.
    cluster String
    The ID of the cluster that you want to manage, When role_type value is all-clusters, the value of cluster must be "".
    roleName String
    Specifies the predefined role that you want to assign. Valid values admin, ops, dev, restricted and the custom cluster roles.
    roleType String
    The authorization type. Valid values cluster, namespace and all-clusters.
    isCustom Boolean
    Specifies whether to perform a custom authorization. To perform a custom authorization, the value of is_custom must be true, and set role_name to a custom cluster role.
    isRamRole Boolean
    Specifies whether the permissions are granted to a RAM role. When uid is ram role id, the value of is_ram_role must be true.
    namespace String
    The namespace to which the permissions are scoped. This parameter is required only if you set role_type to namespace.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi