GetRoles

This data source provides a list of RAM Roles in an Alibaba Cloud account according to the specified filters.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var rolesDs = Output.Create(AliCloud.Ram.GetRoles.InvokeAsync(new AliCloud.Ram.GetRolesArgs
        {
            NameRegex = ".*test.*",
            OutputFile = "roles.txt",
            PolicyName = "AliyunACSDefaultAccess",
            PolicyType = "Custom",
        }));
        this.FirstRoleId = rolesDs.Apply(rolesDs => rolesDs.Roles[0].Id);
    }

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

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

roles_ds = alicloud.ram.get_roles(name_regex=".*test.*",
    output_file="roles.txt",
    policy_name="AliyunACSDefaultAccess",
    policy_type="Custom")
pulumi.export("firstRoleId", roles_ds.roles[0]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const rolesDs = pulumi.output(alicloud.ram.getRoles({
    nameRegex: ".*test.*",
    outputFile: "roles.txt",
    policyName: "AliyunACSDefaultAccess",
    policyType: "Custom",
}, { async: true }));

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

Using GetRoles

function getRoles(args: GetRolesArgs, opts?: InvokeOptions): Promise<GetRolesResult>
function  get_roles(ids=None, name_regex=None, output_file=None, policy_name=None, policy_type=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 ram role IDs.
NameRegex string

A regex string to filter results by the role name.

OutputFile string
PolicyName string

Filter results by a specific policy name. If you set this parameter without setting policy_type, the later will be automatically set to System. The resulting roles will be attached to the specified policy.

PolicyType string

Filter results by a specific policy type. Valid values are Custom and System. If you set this parameter, you must set policy_name as well.

Ids []string
  • A list of ram role IDs.
NameRegex string

A regex string to filter results by the role name.

OutputFile string
PolicyName string

Filter results by a specific policy name. If you set this parameter without setting policy_type, the later will be automatically set to System. The resulting roles will be attached to the specified policy.

PolicyType string

Filter results by a specific policy type. Valid values are Custom and System. If you set this parameter, you must set policy_name as well.

ids string[]
  • A list of ram role IDs.
nameRegex string

A regex string to filter results by the role name.

outputFile string
policyName string

Filter results by a specific policy name. If you set this parameter without setting policy_type, the later will be automatically set to System. The resulting roles will be attached to the specified policy.

policyType string

Filter results by a specific policy type. Valid values are Custom and System. If you set this parameter, you must set policy_name as well.

ids List[str]
  • A list of ram role IDs.
name_regex str

A regex string to filter results by the role name.

output_file str
policy_name str

Filter results by a specific policy name. If you set this parameter without setting policy_type, the later will be automatically set to System. The resulting roles will be attached to the specified policy.

policy_type str

Filter results by a specific policy type. Valid values are Custom and System. If you set this parameter, you must set policy_name as well.

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 ram role IDs.

Names List<string>

A list of ram role names.

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

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

NameRegex string
OutputFile string
PolicyName string
PolicyType string
Id string

The provider-assigned unique ID for this managed resource.

Ids []string

A list of ram role IDs.

Names []string

A list of ram role names.

Roles []GetRolesRole

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

NameRegex string
OutputFile string
PolicyName string
PolicyType string
id string

The provider-assigned unique ID for this managed resource.

ids string[]

A list of ram role IDs.

names string[]

A list of ram role names.

roles GetRolesRole[]

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

nameRegex string
outputFile string
policyName string
policyType string
id str

The provider-assigned unique ID for this managed resource.

ids List[str]

A list of ram role IDs.

names List[str]

A list of ram role names.

roles List[GetRolesRole]

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

name_regex str
output_file str
policy_name str
policy_type 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

Resource descriptor of the role.

AssumeRolePolicyDocument string

Authorization strategy of the role. This parameter is deprecated and replaced by document.

CreateDate string

Creation date of the role.

Description string

Description of the role.

Document string

Authorization strategy of the role.

Id string

Id of the role.

Name string

Name of the role.

UpdateDate string

Update date of the role.

Arn string

Resource descriptor of the role.

AssumeRolePolicyDocument string

Authorization strategy of the role. This parameter is deprecated and replaced by document.

CreateDate string

Creation date of the role.

Description string

Description of the role.

Document string

Authorization strategy of the role.

Id string

Id of the role.

Name string

Name of the role.

UpdateDate string

Update date of the role.

arn string

Resource descriptor of the role.

assumeRolePolicyDocument string

Authorization strategy of the role. This parameter is deprecated and replaced by document.

createDate string

Creation date of the role.

description string

Description of the role.

document string

Authorization strategy of the role.

id string

Id of the role.

name string

Name of the role.

updateDate string

Update date of the role.

arn str

Resource descriptor of the role.

assume_role_policy_document str

Authorization strategy of the role. This parameter is deprecated and replaced by document.

create_date str

Creation date of the role.

description str

Description of the role.

document str

Authorization strategy of the role.

id str

Id of the role.

name str

Name of the role.

update_date str

Update date of the role.

Package Details

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