getHostGroups

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

NOTE: Available in v1.134.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.GetHostGroupsArgs;
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.getHostGroups(GetHostGroupsArgs.builder()
.instanceId("bastionhost-cn-tl3xxxxxxx")
.ids(
"example_value-1",
"example_value-2")
.build());
ctx.export("bastionhostHostGroupId1", ids.applyValue(getHostGroupsResult -> getHostGroupsResult.groups()[0].id()));
final var nameRegex = BastionhostFunctions.getHostGroups(GetHostGroupsArgs.builder()
.instanceId("bastionhost-cn-tl3xxxxxxx")
.nameRegex("^my-HostGroup")
.build());
ctx.export("bastionhostHostGroupId2", nameRegex.applyValue(getHostGroupsResult -> getHostGroupsResult.groups()[0].id()));
}
}

Return

A collection of values returned by getHostGroups.

Parameters

argument

A collection of arguments for invoking getHostGroups.


suspend fun getHostGroups(hostGroupName: String? = null, ids: List<String>? = null, instanceId: String, nameRegex: String? = null, outputFile: String? = null): GetHostGroupsResult

Return

A collection of values returned by getHostGroups.

See also

Parameters

hostGroupName

Specify the New Host Group Name, Supports up to 128 Characters.

ids

A list of Host Group IDs.

instanceId

Specify the New Host Group Where the Bastion Host ID of.

nameRegex

A regex string to filter results by Host Group name.

outputFile

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


Return

A collection of values returned by getHostGroups.

See also

Parameters

argument

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