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.
- Name
Regex string A regex string to filter results by role name.
- Output
File 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.
Ali Cloud. Resource Manager. Outputs. Get Roles Role> A list of roles. Each element contains the following attributes:
- Name
Regex string - Output
File 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[Get
Roles Role] 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
- Create
Date 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.- Max
Session intDuration - Role
Id string - Role
Name string - Update
Date string
- Arn string
- Create
Date 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.- Max
Session intDuration - Role
Id string - Role
Name string - Update
Date string
- arn string
- create
Date 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.- max
Session numberDuration - role
Id string - role
Name string - update
Date 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_ floatduration - 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
alicloudTerraform Provider.