1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. cs
  5. getKubernetesPermission
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.cs.getKubernetesPermission

Explore with Pulumi AI

This data source provides a list of Ram user permissions.

NOTE: Available since v1.122.0.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

// Declare the data source
const _default = alicloud.ram.getUsers({});
// permissions
const defaultGetKubernetesPermission = _default.then(_default => alicloud.cs.getKubernetesPermission({
    uid: _default.users?.[0]?.id,
}));
export const permissions = defaultGetKubernetesPermission.then(defaultGetKubernetesPermission => defaultGetKubernetesPermission.permissions);
Copy
import pulumi
import pulumi_alicloud as alicloud

# Declare the data source
default = alicloud.ram.get_users()
# permissions
default_get_kubernetes_permission = alicloud.cs.get_kubernetes_permission(uid=default.users[0].id)
pulumi.export("permissions", default_get_kubernetes_permission.permissions)
Copy
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cs"
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ram"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// Declare the data source
		_default, err := ram.GetUsers(ctx, &ram.GetUsersArgs{}, nil)
		if err != nil {
			return err
		}
		// permissions
		defaultGetKubernetesPermission, err := cs.LookupKubernetesPermission(ctx, &cs.LookupKubernetesPermissionArgs{
			Uid: _default.Users[0].Id,
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("permissions", defaultGetKubernetesPermission.Permissions)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    // Declare the data source
    var @default = AliCloud.Ram.GetUsers.Invoke();

    // permissions
    var defaultGetKubernetesPermission = AliCloud.CS.GetKubernetesPermission.Invoke(new()
    {
        Uid = @default.Apply(getUsersResult => getUsersResult.Users[0]?.Id),
    });

    return new Dictionary<string, object?>
    {
        ["permissions"] = defaultGetKubernetesPermission.Apply(getKubernetesPermissionResult => getKubernetesPermissionResult.Permissions),
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.ram.RamFunctions;
import com.pulumi.alicloud.ram.inputs.GetUsersArgs;
import com.pulumi.alicloud.cs.CsFunctions;
import com.pulumi.alicloud.cs.inputs.GetKubernetesPermissionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        // Declare the data source
        final var default = RamFunctions.getUsers();

        // permissions
        final var defaultGetKubernetesPermission = CsFunctions.getKubernetesPermission(GetKubernetesPermissionArgs.builder()
            .uid(default_.users()[0].id())
            .build());

        ctx.export("permissions", defaultGetKubernetesPermission.applyValue(getKubernetesPermissionResult -> getKubernetesPermissionResult.permissions()));
    }
}
Copy
variables:
  # Declare the data source
  default:
    fn::invoke:
      function: alicloud:ram:getUsers
      arguments: {}
  # permissions
  defaultGetKubernetesPermission:
    fn::invoke:
      function: alicloud:cs:getKubernetesPermission
      arguments:
        uid: ${default.users[0].id}
outputs:
  permissions: ${defaultGetKubernetesPermission.permissions}
Copy

Using getKubernetesPermission

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getKubernetesPermission(args: GetKubernetesPermissionArgs, opts?: InvokeOptions): Promise<GetKubernetesPermissionResult>
function getKubernetesPermissionOutput(args: GetKubernetesPermissionOutputArgs, opts?: InvokeOptions): Output<GetKubernetesPermissionResult>
Copy
def get_kubernetes_permission(uid: Optional[str] = None,
                              opts: Optional[InvokeOptions] = None) -> GetKubernetesPermissionResult
def get_kubernetes_permission_output(uid: Optional[pulumi.Input[str]] = None,
                              opts: Optional[InvokeOptions] = None) -> Output[GetKubernetesPermissionResult]
Copy
func LookupKubernetesPermission(ctx *Context, args *LookupKubernetesPermissionArgs, opts ...InvokeOption) (*LookupKubernetesPermissionResult, error)
func LookupKubernetesPermissionOutput(ctx *Context, args *LookupKubernetesPermissionOutputArgs, opts ...InvokeOption) LookupKubernetesPermissionResultOutput
Copy

> Note: This function is named LookupKubernetesPermission in the Go SDK.

public static class GetKubernetesPermission 
{
    public static Task<GetKubernetesPermissionResult> InvokeAsync(GetKubernetesPermissionArgs args, InvokeOptions? opts = null)
    public static Output<GetKubernetesPermissionResult> Invoke(GetKubernetesPermissionInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetKubernetesPermissionResult> getKubernetesPermission(GetKubernetesPermissionArgs args, InvokeOptions options)
public static Output<GetKubernetesPermissionResult> getKubernetesPermission(GetKubernetesPermissionArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:cs/getKubernetesPermission:getKubernetesPermission
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Uid This property is required. string
The ID of the RAM user. If you want to query the permissions of a RAM role, specify the ID of the RAM role.
Uid This property is required. string
The ID of the RAM user. If you want to query the permissions of a RAM role, specify the ID of the RAM role.
uid This property is required. String
The ID of the RAM user. If you want to query the permissions of a RAM role, specify the ID of the RAM role.
uid This property is required. string
The ID of the RAM user. If you want to query the permissions of a RAM role, specify the ID of the RAM role.
uid This property is required. str
The ID of the RAM user. If you want to query the permissions of a RAM role, specify the ID of the RAM role.
uid This property is required. String
The ID of the RAM user. If you want to query the permissions of a RAM role, specify the ID of the RAM role.

getKubernetesPermission Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Permissions List<Pulumi.AliCloud.CS.Outputs.GetKubernetesPermissionPermission>
A list of user permission. See permissions below.
Uid string
The ID of the RAM user. If you want to query the permissions of a RAM role, specify the ID of the RAM role.
Id string
The provider-assigned unique ID for this managed resource.
Permissions []GetKubernetesPermissionPermission
A list of user permission. See permissions below.
Uid string
The ID of the RAM user. If you want to query the permissions of a RAM role, specify the ID of the RAM role.
id String
The provider-assigned unique ID for this managed resource.
permissions List<GetKubernetesPermissionPermission>
A list of user permission. See permissions below.
uid String
The ID of the RAM user. If you want to query the permissions of a RAM role, specify the ID of the RAM role.
id string
The provider-assigned unique ID for this managed resource.
permissions GetKubernetesPermissionPermission[]
A list of user permission. See permissions below.
uid string
The ID of the RAM user. If you want to query the permissions of a RAM role, specify the ID of the RAM role.
id str
The provider-assigned unique ID for this managed resource.
permissions Sequence[GetKubernetesPermissionPermission]
A list of user permission. See permissions below.
uid str
The ID of the RAM user. If you want to query the permissions of a RAM role, specify the ID of the RAM role.
id String
The provider-assigned unique ID for this managed resource.
permissions List<Property Map>
A list of user permission. See permissions below.
uid String
The ID of the RAM user. If you want to query the permissions of a RAM role, specify the ID of the RAM role.

Supporting Types

GetKubernetesPermissionPermission

IsOwner This property is required. bool
Indicates whether the permissions are granted to the cluster owner. Valid values false, true.
IsRamRole This property is required. bool
Indicates whether the permissions are granted to the RAM role. Valid values false, true.
ResourceId This property is required. string
The permission settings to manage ACK clusters.
ResourceType This property is required. string
The authorization type. Valid values cluster, namespace and console.
RoleName This property is required. string
The name of the predefined role. If a custom role is assigned, the value is the name of the assigined custom role.
RoleType This property is required. string
The predefined role. Valid values admin,ops,dev,restricted and custom.
IsOwner This property is required. bool
Indicates whether the permissions are granted to the cluster owner. Valid values false, true.
IsRamRole This property is required. bool
Indicates whether the permissions are granted to the RAM role. Valid values false, true.
ResourceId This property is required. string
The permission settings to manage ACK clusters.
ResourceType This property is required. string
The authorization type. Valid values cluster, namespace and console.
RoleName This property is required. string
The name of the predefined role. If a custom role is assigned, the value is the name of the assigined custom role.
RoleType This property is required. string
The predefined role. Valid values admin,ops,dev,restricted and custom.
isOwner This property is required. Boolean
Indicates whether the permissions are granted to the cluster owner. Valid values false, true.
isRamRole This property is required. Boolean
Indicates whether the permissions are granted to the RAM role. Valid values false, true.
resourceId This property is required. String
The permission settings to manage ACK clusters.
resourceType This property is required. String
The authorization type. Valid values cluster, namespace and console.
roleName This property is required. String
The name of the predefined role. If a custom role is assigned, the value is the name of the assigined custom role.
roleType This property is required. String
The predefined role. Valid values admin,ops,dev,restricted and custom.
isOwner This property is required. boolean
Indicates whether the permissions are granted to the cluster owner. Valid values false, true.
isRamRole This property is required. boolean
Indicates whether the permissions are granted to the RAM role. Valid values false, true.
resourceId This property is required. string
The permission settings to manage ACK clusters.
resourceType This property is required. string
The authorization type. Valid values cluster, namespace and console.
roleName This property is required. string
The name of the predefined role. If a custom role is assigned, the value is the name of the assigined custom role.
roleType This property is required. string
The predefined role. Valid values admin,ops,dev,restricted and custom.
is_owner This property is required. bool
Indicates whether the permissions are granted to the cluster owner. Valid values false, true.
is_ram_role This property is required. bool
Indicates whether the permissions are granted to the RAM role. Valid values false, true.
resource_id This property is required. str
The permission settings to manage ACK clusters.
resource_type This property is required. str
The authorization type. Valid values cluster, namespace and console.
role_name This property is required. str
The name of the predefined role. If a custom role is assigned, the value is the name of the assigined custom role.
role_type This property is required. str
The predefined role. Valid values admin,ops,dev,restricted and custom.
isOwner This property is required. Boolean
Indicates whether the permissions are granted to the cluster owner. Valid values false, true.
isRamRole This property is required. Boolean
Indicates whether the permissions are granted to the RAM role. Valid values false, true.
resourceId This property is required. String
The permission settings to manage ACK clusters.
resourceType This property is required. String
The authorization type. Valid values cluster, namespace and console.
roleName This property is required. String
The name of the predefined role. If a custom role is assigned, the value is the name of the assigined custom role.
roleType This property is required. String
The predefined role. Valid values admin,ops,dev,restricted and custom.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.