alicloud.cs.KubernetesPermission
Explore with Pulumi AI
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
orForbiddenGrantPermissions
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
totrue
during authorization. - Permissions
List<Pulumi.
Ali Cloud. CS. Inputs. Kubernetes Permission Permission> - 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
totrue
during authorization. - Permissions
[]Kubernetes
Permission Permission Args - 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
totrue
during authorization. - permissions
List<Kubernetes
Permission Permission> - 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
totrue
during authorization. - permissions
Kubernetes
Permission Permission[] - 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
totrue
during authorization. - permissions
Sequence[Kubernetes
Permission Permission Args] - 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
totrue
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.
- Permissions
List<Pulumi.
Ali Cloud. CS. Inputs. Kubernetes Permission Permission> - 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
totrue
during authorization.
- Permissions
[]Kubernetes
Permission Permission Args - 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
totrue
during authorization.
- permissions
List<Kubernetes
Permission Permission> - 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
totrue
during authorization.
- permissions
Kubernetes
Permission Permission[] - 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
totrue
during authorization.
- permissions
Sequence[Kubernetes
Permission Permission Args] - 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
totrue
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
totrue
during authorization.
Supporting Types
KubernetesPermissionPermission, KubernetesPermissionPermissionArgs
- Cluster string
- The ID of the cluster that you want to manage, When
role_type
value isall-clusters
, the value ofcluster
must be""
. - Role
Name string - Specifies the predefined role that you want to assign. Valid values
admin
,ops
,dev
,restricted
and the custom cluster roles. - Role
Type string - The authorization type. Valid values
cluster
,namespace
andall-clusters
. - Is
Custom bool - Specifies whether to perform a custom authorization. To perform a custom authorization, the value of
is_custom
must betrue
, and setrole_name
to a custom cluster role. - Is
Ram boolRole - Specifies whether the permissions are granted to a RAM role. When
uid
is ram role id, the value ofis_ram_role
must betrue
. - 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 isall-clusters
, the value ofcluster
must be""
. - Role
Name string - Specifies the predefined role that you want to assign. Valid values
admin
,ops
,dev
,restricted
and the custom cluster roles. - Role
Type string - The authorization type. Valid values
cluster
,namespace
andall-clusters
. - Is
Custom bool - Specifies whether to perform a custom authorization. To perform a custom authorization, the value of
is_custom
must betrue
, and setrole_name
to a custom cluster role. - Is
Ram boolRole - Specifies whether the permissions are granted to a RAM role. When
uid
is ram role id, the value ofis_ram_role
must betrue
. - 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 isall-clusters
, the value ofcluster
must be""
. - role
Name String - Specifies the predefined role that you want to assign. Valid values
admin
,ops
,dev
,restricted
and the custom cluster roles. - role
Type String - The authorization type. Valid values
cluster
,namespace
andall-clusters
. - is
Custom Boolean - Specifies whether to perform a custom authorization. To perform a custom authorization, the value of
is_custom
must betrue
, and setrole_name
to a custom cluster role. - is
Ram BooleanRole - Specifies whether the permissions are granted to a RAM role. When
uid
is ram role id, the value ofis_ram_role
must betrue
. - 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 isall-clusters
, the value ofcluster
must be""
. - role
Name string - Specifies the predefined role that you want to assign. Valid values
admin
,ops
,dev
,restricted
and the custom cluster roles. - role
Type string - The authorization type. Valid values
cluster
,namespace
andall-clusters
. - is
Custom boolean - Specifies whether to perform a custom authorization. To perform a custom authorization, the value of
is_custom
must betrue
, and setrole_name
to a custom cluster role. - is
Ram booleanRole - Specifies whether the permissions are granted to a RAM role. When
uid
is ram role id, the value ofis_ram_role
must betrue
. - 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 isall-clusters
, the value ofcluster
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
andall-clusters
. - is_
custom bool - Specifies whether to perform a custom authorization. To perform a custom authorization, the value of
is_custom
must betrue
, and setrole_name
to a custom cluster role. - is_
ram_ boolrole - Specifies whether the permissions are granted to a RAM role. When
uid
is ram role id, the value ofis_ram_role
must betrue
. - 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 isall-clusters
, the value ofcluster
must be""
. - role
Name String - Specifies the predefined role that you want to assign. Valid values
admin
,ops
,dev
,restricted
and the custom cluster roles. - role
Type String - The authorization type. Valid values
cluster
,namespace
andall-clusters
. - is
Custom Boolean - Specifies whether to perform a custom authorization. To perform a custom authorization, the value of
is_custom
must betrue
, and setrole_name
to a custom cluster role. - is
Ram BooleanRole - Specifies whether the permissions are granted to a RAM role. When
uid
is ram role id, the value ofis_ram_role
must betrue
. - 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.