get User Groups
This data source provides the Bastionhost User Groups of the current Alibaba Cloud user.
NOTE: Available in v1.132.0+.
Example Usage
Basic Usage
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.GetUserGroupsArgs;
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.getUserGroups(GetUserGroupsArgs.builder()
.instanceId("bastionhost-cn-xxxx")
.ids(
"1",
"2")
.build());
ctx.export("bastionhostUserGroupId1", ids.applyValue(getUserGroupsResult -> getUserGroupsResult.groups()[0].id()));
final var nameRegex = BastionhostFunctions.getUserGroups(GetUserGroupsArgs.builder()
.instanceId("bastionhost-cn-xxxx")
.nameRegex("^my-UserGroup")
.build());
ctx.export("bastionhostUserGroupId2", nameRegex.applyValue(getUserGroupsResult -> getUserGroupsResult.groups()[0].id()));
}
}
Content copied to clipboard
Return
A collection of values returned by getUserGroups.
Parameters
argument
A collection of arguments for invoking getUserGroups.
suspend fun getUserGroups(ids: List<String>? = null, instanceId: String, nameRegex: String? = null, outputFile: String? = null, userGroupName: String? = null): GetUserGroupsResult
Return
A collection of values returned by getUserGroups.
See also
Parameters
ids
A list of User Group self IDs.
instance Id
Specify the New Group of the Bastion Host of Instance Id.
name Regex
A regex string to filter results by User Group name.
output File
user Group Name
Specify the New Group Name. Supports up to 128 Characters.
suspend fun getUserGroups(argument: suspend GetUserGroupsPlainArgsBuilder.() -> Unit): GetUserGroupsResult
Return
A collection of values returned by getUserGroups.
See also
Parameters
argument
Builder for com.pulumi.alicloud.bastionhost.kotlin.inputs.GetUserGroupsPlainArgs.