GetRoles

This data source provides the Resource Manager Roles of the current Alibaba Cloud user.

NOTE: Available in 1.86.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(AliCloud.ResourceManager.GetRoles.InvokeAsync(new AliCloud.ResourceManager.GetRolesArgs
        {
            NameRegex = "tftest",
        }));
        this.FirstRoleId = example.Apply(example => example.Roles[0].Id);
    }

    [Output("firstRoleId")]
    public Output<string> FirstRoleId { get; set; }
}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

example = alicloud.resourcemanager.get_roles(name_regex="tftest")
pulumi.export("firstRoleId", example.roles[0]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const example = pulumi.output(alicloud.resourcemanager.getRoles({
    nameRegex: "tftest",
}, { async: true }));

export const firstRoleId = example.roles[0].id;

Using GetRoles

function getRoles(args: GetRolesArgs, opts?: InvokeOptions): Promise<GetRolesResult>
function  get_roles(ids=None, name_regex=None, output_file=None, opts=None)
func GetRoles(ctx *Context, args *GetRolesArgs, opts ...InvokeOption) (*GetRolesResult, error)
public static class GetRoles {
    public static Task<GetRolesResult> InvokeAsync(GetRolesArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Ids List<string>

A list of Resource Manager Role IDs.

NameRegex string

A regex string to filter results by role name.

OutputFile string
Ids []string

A list of Resource Manager Role IDs.

NameRegex string

A regex string to filter results by role name.

OutputFile string
ids string[]

A list of Resource Manager Role IDs.

nameRegex string

A regex string to filter results by role name.

outputFile string
ids List[str]

A list of Resource Manager Role IDs.

name_regex str

A regex string to filter results by role name.

output_file str

GetRoles Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>

A list of role IDs.

Names List<string>

A list of role names.

Roles List<Pulumi.AliCloud.ResourceManager.Outputs.GetRolesRole>

A list of roles. Each element contains the following attributes:

NameRegex string
OutputFile string
Id string

The provider-assigned unique ID for this managed resource.

Ids []string

A list of role IDs.

Names []string

A list of role names.

Roles []GetRolesRole

A list of roles. Each element contains the following attributes:

NameRegex string
OutputFile string
id string

The provider-assigned unique ID for this managed resource.

ids string[]

A list of role IDs.

names string[]

A list of role names.

roles GetRolesRole[]

A list of roles. Each element contains the following attributes:

nameRegex string
outputFile string
id str

The provider-assigned unique ID for this managed resource.

ids List[str]

A list of role IDs.

names List[str]

A list of role names.

roles List[GetRolesRole]

A list of roles. Each element contains the following attributes:

name_regex str
output_file str

Supporting Types

GetRolesRole

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

Arn string
CreateDate string
Description string
Id string

The ID of the role. * role_id- The ID of the role. * role_name- The name of the role. * arn- The Alibaba Cloud Resource Name (ARN) of the RAM role. * create_date- The time when the RAM role was created. * update_date- The time when the RAM role was updated. * description- The description of the RAM role. * max_session_duration- The maximum session duration of the RAM role.

MaxSessionDuration int
RoleId string
RoleName string
UpdateDate string
Arn string
CreateDate string
Description string
Id string

The ID of the role. * role_id- The ID of the role. * role_name- The name of the role. * arn- The Alibaba Cloud Resource Name (ARN) of the RAM role. * create_date- The time when the RAM role was created. * update_date- The time when the RAM role was updated. * description- The description of the RAM role. * max_session_duration- The maximum session duration of the RAM role.

MaxSessionDuration int
RoleId string
RoleName string
UpdateDate string
arn string
createDate string
description string
id string

The ID of the role. * role_id- The ID of the role. * role_name- The name of the role. * arn- The Alibaba Cloud Resource Name (ARN) of the RAM role. * create_date- The time when the RAM role was created. * update_date- The time when the RAM role was updated. * description- The description of the RAM role. * max_session_duration- The maximum session duration of the RAM role.

maxSessionDuration number
roleId string
roleName string
updateDate string
arn str
create_date str
description str
id str

The ID of the role. * role_id- The ID of the role. * role_name- The name of the role. * arn- The Alibaba Cloud Resource Name (ARN) of the RAM role. * create_date- The time when the RAM role was created. * update_date- The time when the RAM role was updated. * description- The description of the RAM role. * max_session_duration- The maximum session duration of the RAM role.

max_session_duration float
role_id str
role_name str
update_date str

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.