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:
- Group
Name string Filter results by a specific group name. Returned users are in the specified group.
- Ids List<string>
- A list of ram user IDs.
- Name
Regex string A regex string to filter resulting users by their names.
- Output
File string - Policy
Name string Filter results by a specific policy name. If you set this parameter without setting
policy_type, the later will be automatically set toSystem. Returned users are attached to the specified policy.- Policy
Type string Filter results by a specific policy type. Valid values are
CustomandSystem. If you set this parameter, you must setpolicy_nameas well.
- Group
Name string Filter results by a specific group name. Returned users are in the specified group.
- Ids []string
- A list of ram user IDs.
- Name
Regex string A regex string to filter resulting users by their names.
- Output
File string - Policy
Name string Filter results by a specific policy name. If you set this parameter without setting
policy_type, the later will be automatically set toSystem. Returned users are attached to the specified policy.- Policy
Type string Filter results by a specific policy type. Valid values are
CustomandSystem. If you set this parameter, you must setpolicy_nameas well.
- group
Name string Filter results by a specific group name. Returned users are in the specified group.
- ids string[]
- A list of ram user IDs.
- name
Regex string A regex string to filter resulting users by their names.
- output
File string - policy
Name string Filter results by a specific policy name. If you set this parameter without setting
policy_type, the later will be automatically set toSystem. Returned users are attached to the specified policy.- policy
Type string Filter results by a specific policy type. Valid values are
CustomandSystem. If you set this parameter, you must setpolicy_nameas 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 toSystem. Returned users are attached to the specified policy.- policy_
type str Filter results by a specific policy type. Valid values are
CustomandSystem. If you set this parameter, you must setpolicy_nameas 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.
Ali Cloud. Ram. Outputs. Get Users User> A list of users. Each element contains the following attributes:
- Group
Name string - Name
Regex string - Output
File string - Policy
Name string - Policy
Type 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
[]Get
Users User A list of users. Each element contains the following attributes:
- Group
Name string - Name
Regex string - Output
File string - Policy
Name string - Policy
Type 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
Get
Users User[] A list of users. Each element contains the following attributes:
- group
Name string - name
Regex string - output
File string - policy
Name string - policy
Type 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[Get
Users User] 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.
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.