Alibaba Cloud
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:
- Enable
Details 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.
- Name
Regex string A regex string to filter results by role name.
- Output
File string
- Enable
Details 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.
- Name
Regex string A regex string to filter results by role name.
- Output
File string
- enable
Details 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.
- name
Regex String A regex string to filter results by role name.
- output
File String
- enable
Details 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.
- name
Regex string A regex string to filter results by role name.
- output
File 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
- enable
Details 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.
- name
Regex String A regex string to filter results by role name.
- output
File 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.
Ali Cloud. Resource Manager. Outputs. Get Roles Role> A list of roles. Each element contains the following attributes:
- Enable
Details bool - Name
Regex string - Output
File 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
[]Get
Roles Role A list of roles. Each element contains the following attributes:
- Enable
Details bool - Name
Regex string - Output
File 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
List
Roles Role> A list of roles. Each element contains the following attributes:
- enable
Details Boolean - name
Regex String - output
File 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
Get
Roles Role[] A list of roles. Each element contains the following attributes:
- enable
Details boolean - name
Regex string - output
File 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[Get
Roles Role] 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:
- enable
Details Boolean - name
Regex String - output
File String
Supporting Types
GetRolesRole
- Arn string
- Assume
Role stringPolicy Document - 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.
- Max
Session intDuration - Role
Id string - Role
Name string - Update
Date string
- Arn string
- Assume
Role stringPolicy Document - 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.
- Max
Session intDuration - Role
Id string - Role
Name string - Update
Date string
- arn String
- assume
Role StringPolicy Document - 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.
- max
Session IntegerDuration - role
Id String - role
Name String - update
Date String
- arn string
- assume
Role stringPolicy Document - 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.
- max
Session numberDuration - role
Id string - role
Name string - update
Date string
- arn str
- assume_
role_ strpolicy_ document - 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_ intduration - role_
id str - role_
name str - update_
date str
- arn String
- assume
Role StringPolicy Document - 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.
- max
Session NumberDuration - role
Id String - role
Name String - update
Date 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.