Alibaba Cloud

Pulumi Official
Package maintained by Pulumi
v3.19.0 published on Friday, Mar 18, 2022 by Pulumi

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; }
}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := resourcemanager.GetRoles(ctx, &resourcemanager.GetRolesArgs{
			NameRegex: pulumi.StringRef("tftest"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("firstRoleId", example.Roles[0].Id)
		return nil
	})
}

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",
}));

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

Coming soon!

Using getRoles

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 getRoles(args: GetRolesArgs, opts?: InvokeOptions): Promise<GetRolesResult>
function getRolesOutput(args: GetRolesOutputArgs, opts?: InvokeOptions): Output<GetRolesResult>
def get_roles(enable_details: Optional[bool] = None,
              ids: Optional[Sequence[str]] = None,
              name_regex: Optional[str] = None,
              output_file: Optional[str] = None,
              opts: Optional[InvokeOptions] = None) -> GetRolesResult
def get_roles_output(enable_details: Optional[pulumi.Input[bool]] = None,
              ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
              name_regex: Optional[pulumi.Input[str]] = None,
              output_file: Optional[pulumi.Input[str]] = None,
              opts: Optional[InvokeOptions] = None) -> Output[GetRolesResult]
func GetRoles(ctx *Context, args *GetRolesArgs, opts ...InvokeOption) (*GetRolesResult, error)
func GetRolesOutput(ctx *Context, args *GetRolesOutputArgs, opts ...InvokeOption) GetRolesResultOutput

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

public static class GetRoles 
{
    public static Task<GetRolesResult> InvokeAsync(GetRolesArgs args, InvokeOptions? opts = null)
    public static Output<GetRolesResult> Invoke(GetRolesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetRolesResult> getRoles(GetRolesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: alicloud:resourcemanager/getRoles:getRoles
  Arguments:
    # Arguments dictionary

The following arguments are supported:

EnableDetails bool

-(Optional, Available in v1.114.0+) Default to false. Set it to true can output more details.

Ids List<string>

A list of Resource Manager Role IDs.

NameRegex string

A regex string to filter results by role name.

OutputFile string
EnableDetails bool

-(Optional, Available in v1.114.0+) Default to false. Set it to true can output more details.

Ids []string

A list of Resource Manager Role IDs.

NameRegex string

A regex string to filter results by role name.

OutputFile string
enableDetails Boolean

-(Optional, Available in v1.114.0+) Default to false. Set it to true can output more details.

ids List

A list of Resource Manager Role IDs.

nameRegex String

A regex string to filter results by role name.

outputFile String
enableDetails boolean

-(Optional, Available in v1.114.0+) Default to false. Set it to true can output more details.

ids string[]

A list of Resource Manager Role IDs.

nameRegex string

A regex string to filter results by role name.

outputFile string
enable_details bool

-(Optional, Available in v1.114.0+) Default to false. Set it to true can output more details.

ids Sequence[str]

A list of Resource Manager Role IDs.

name_regex str

A regex string to filter results by role name.

output_file str
enableDetails Boolean

-(Optional, Available in v1.114.0+) Default to false. Set it to true can output more details.

ids List

A list of Resource Manager Role IDs.

nameRegex String

A regex string to filter results by role name.

outputFile String

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:

EnableDetails bool
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:

EnableDetails bool
NameRegex string
OutputFile string
id String

The provider-assigned unique ID for this managed resource.

ids List

A list of role IDs.

names List

A list of role names.

roles ListRolesRole>

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

enableDetails Boolean
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:

enableDetails boolean
nameRegex string
outputFile string
id str

The provider-assigned unique ID for this managed resource.

ids Sequence[str]

A list of role IDs.

names Sequence[str]

A list of role names.

roles Sequence[GetRolesRole]

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

enable_details bool
name_regex str
output_file str
id String

The provider-assigned unique ID for this managed resource.

ids List

A list of role IDs.

names List

A list of role names.

roles List

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

enableDetails Boolean
nameRegex String
outputFile String

Supporting Types

GetRolesRole

Arn string
AssumeRolePolicyDocument 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- (Removed form v1.114.0) 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.
  • assume_role_policy_document- (Available in v1.114.0+) The assume role policy document.
MaxSessionDuration int
RoleId string
RoleName string
UpdateDate string
Arn string
AssumeRolePolicyDocument 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- (Removed form v1.114.0) 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.
  • assume_role_policy_document- (Available in v1.114.0+) The assume role policy document.
MaxSessionDuration int
RoleId string
RoleName string
UpdateDate string
arn String
assumeRolePolicyDocument 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- (Removed form v1.114.0) 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.
  • assume_role_policy_document- (Available in v1.114.0+) The assume role policy document.
maxSessionDuration Integer
roleId String
roleName String
updateDate String
arn string
assumeRolePolicyDocument 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- (Removed form v1.114.0) 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.
  • assume_role_policy_document- (Available in v1.114.0+) The assume role policy document.
maxSessionDuration number
roleId string
roleName string
updateDate string
arn str
assume_role_policy_document 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- (Removed form v1.114.0) 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.
  • assume_role_policy_document- (Available in v1.114.0+) The assume role policy document.
max_session_duration int
role_id str
role_name str
update_date str
arn String
assumeRolePolicyDocument 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- (Removed form v1.114.0) 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.
  • assume_role_policy_document- (Available in v1.114.0+) The assume role policy document.
maxSessionDuration Number
roleId String
roleName String
updateDate String

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.