GetUsers

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

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var usersDs = Output.Create(AliCloud.Ram.GetUsers.InvokeAsync(new AliCloud.Ram.GetUsersArgs
        {
            GroupName = "group1",
            NameRegex = "^user",
            OutputFile = "users.txt",
            PolicyName = "AliyunACSDefaultAccess",
            PolicyType = "Custom",
        }));
        this.FirstUserId = usersDs.Apply(usersDs => usersDs.Users[0].Id);
    }

    [Output("firstUserId")]
    public Output<string> FirstUserId { get; set; }
}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

users_ds = alicloud.ram.get_users(group_name="group1",
    name_regex="^user",
    output_file="users.txt",
    policy_name="AliyunACSDefaultAccess",
    policy_type="Custom")
pulumi.export("firstUserId", users_ds.users[0]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const usersDs = pulumi.output(alicloud.ram.getUsers({
    groupName: "group1",
    nameRegex: "^user",
    outputFile: "users.txt",
    policyName: "AliyunACSDefaultAccess",
    policyType: "Custom",
}, { async: true }));

export const firstUserId = usersDs.users[0].id;

Using GetUsers

function getUsers(args: GetUsersArgs, opts?: InvokeOptions): Promise<GetUsersResult>
function  get_users(group_name=None, ids=None, name_regex=None, output_file=None, policy_name=None, policy_type=None, opts=None)
func GetUsers(ctx *Context, args *GetUsersArgs, opts ...InvokeOption) (*GetUsersResult, error)
public static class GetUsers {
    public static Task<GetUsersResult> InvokeAsync(GetUsersArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

GroupName string

Filter results by a specific group name. Returned users are in the specified group.

Ids List<string>
  • A list of ram user IDs.
NameRegex string

A regex string to filter resulting users by their names.

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. Returned users are 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.

GroupName string

Filter results by a specific group name. Returned users are in the specified group.

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

A regex string to filter resulting users by their names.

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. Returned users are 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.

groupName string

Filter results by a specific group name. Returned users are in the specified group.

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

A regex string to filter resulting users by their names.

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. Returned users are 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.

group_name str

Filter results by a specific group name. Returned users are in the specified group.

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

A regex string to filter resulting users by their names.

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. Returned users are 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.

GetUsers 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 user IDs.

Names List<string>

A list of ram user names.

Users List<Pulumi.AliCloud.Ram.Outputs.GetUsersUser>

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

GroupName string
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 user IDs.

Names []string

A list of ram user names.

Users []GetUsersUser

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

GroupName string
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 user IDs.

names string[]

A list of ram user names.

users GetUsersUser[]

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

groupName string
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 user IDs.

names List[str]

A list of ram user names.

users List[GetUsersUser]

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

group_name str
name_regex str
output_file str
policy_name str
policy_type str

Supporting Types

GetUsersUser

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

CreateDate string

Creation date of the user.

Id string

The original id is user name, but it is user id in 1.37.0+.

Name string

Name of the user.

CreateDate string

Creation date of the user.

Id string

The original id is user name, but it is user id in 1.37.0+.

Name string

Name of the user.

createDate string

Creation date of the user.

id string

The original id is user name, but it is user id in 1.37.0+.

name string

Name of the user.

create_date str

Creation date of the user.

id str

The original id is user name, but it is user id in 1.37.0+.

name str

Name of the user.

Package Details

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