getUsers

suspend fun getUsers(argument: GetUsersPlainArgs): GetUsersResult

This data source provides the Bastionhost Users of the current Alibaba Cloud user.

NOTE: Available in v1.133.0+.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const ids = alicloud.bastionhost.getUsers({
instanceId: "example_value",
ids: [
"1",
"10",
],
});
export const bastionhostUserId1 = ids.then(ids => ids.users?.[0]?.id);
const nameRegex = alicloud.bastionhost.getUsers({
instanceId: "example_value",
nameRegex: "^my-User",
});
export const bastionhostUserId2 = nameRegex.then(nameRegex => nameRegex.users?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
ids = alicloud.bastionhost.get_users(instance_id="example_value",
ids=[
"1",
"10",
])
pulumi.export("bastionhostUserId1", ids.users[0].id)
name_regex = alicloud.bastionhost.get_users(instance_id="example_value",
name_regex="^my-User")
pulumi.export("bastionhostUserId2", name_regex.users[0].id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var ids = AliCloud.BastionHost.GetUsers.Invoke(new()
{
InstanceId = "example_value",
Ids = new[]
{
"1",
"10",
},
});
var nameRegex = AliCloud.BastionHost.GetUsers.Invoke(new()
{
InstanceId = "example_value",
NameRegex = "^my-User",
});
return new Dictionary<string, object?>
{
["bastionhostUserId1"] = ids&#46;Apply(getUsersResult => getUsersResult&#46;Users[0]?.Id),
["bastionhostUserId2"] = nameRegex&#46;Apply(getUsersResult => getUsersResult&#46;Users[0]?.Id),
};
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/bastionhost"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
ids, err := bastionhost.GetUsers(ctx, &bastionhost.GetUsersArgs{
InstanceId: "example_value",
Ids: []string{
"1",
"10",
},
}, nil)
if err != nil {
return err
}
ctx.Export("bastionhostUserId1", ids.Users[0].Id)
nameRegex, err := bastionhost.GetUsers(ctx, &bastionhost.GetUsersArgs{
InstanceId: "example_value",
NameRegex: pulumi.StringRef("^my-User"),
}, nil)
if err != nil {
return err
}
ctx.Export("bastionhostUserId2", nameRegex.Users[0].Id)
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.bastionhost.BastionhostFunctions;
import com.pulumi.alicloud.bastionhost.inputs.GetUsersArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var ids = BastionhostFunctions.getUsers(GetUsersArgs.builder()
.instanceId("example_value")
.ids(
"1",
"10")
.build());
ctx.export("bastionhostUserId1", ids.users()[0].id());
final var nameRegex = BastionhostFunctions.getUsers(GetUsersArgs.builder()
.instanceId("example_value")
.nameRegex("^my-User")
.build());
ctx.export("bastionhostUserId2", nameRegex.users()[0].id());
}
}
variables:
ids:
fn::invoke:
function: alicloud:bastionhost:getUsers
arguments:
instanceId: example_value
ids:
- '1'
- '10'
nameRegex:
fn::invoke:
function: alicloud:bastionhost:getUsers
arguments:
instanceId: example_value
nameRegex: ^my-User
outputs:
bastionhostUserId1: ${ids.users[0].id}
bastionhostUserId2: ${nameRegex.users[0].id}

Return

A collection of values returned by getUsers.

Parameters

argument

A collection of arguments for invoking getUsers.


suspend fun getUsers(displayName: String? = null, ids: List<String>? = null, instanceId: String, mobile: String? = null, nameRegex: String? = null, outputFile: String? = null, source: String? = null, sourceUserId: String? = null, status: String? = null, userName: String? = null): GetUsersResult

Return

A collection of values returned by getUsers.

Parameters

displayName

Specify the New Created the User's Display Name. Supports up to 128 Characters.

ids

A list of User IDs.

instanceId

You Want to Query the User the Bastion Host ID of.

mobile

Specify the New of the User That Created a Different Mobile Phone Number from Your.

nameRegex

A regex string to filter results by User name.

outputFile

File name where to save data source results (after running pulumi preview).

source

Specify the New of the User That Created the Source. Valid Values: Local: Local User RAM: Ram User. Valid values: Local, Ram.

sourceUserId

Specify the Newly Created User Is Uniquely Identified. Indicates That the Parameter Is a Bastion Host Corresponding to the User with the Ram User's Unique Identifier. The Newly Created User Source Grant Permission to a RAM User (That Is, Source Used as a Ram), this Parameter Is Required. You Can Call Access Control of Listusers Interface from the Return Data Userid to Obtain the Parameters.

status

The status of the resource. Valid values: Frozen, Normal.

userName

Specify the New User Name. This Parameter Is Only by Letters, Lowercase Letters, Numbers, and Underscores (_), Supports up to 128 Characters.

See also


suspend fun getUsers(argument: suspend GetUsersPlainArgsBuilder.() -> Unit): GetUsersResult

Return

A collection of values returned by getUsers.

Parameters

argument

Builder for com.pulumi.alicloud.bastionhost.kotlin.inputs.GetUsersPlainArgs.

See also