get Server Groups
This data source provides the Nlb Server Groups of the current Alibaba Cloud user.
NOTE: Available in v1.186.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.nlb.NlbFunctions;
import com.pulumi.alicloud.nlb.inputs.GetServerGroupsArgs;
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 = NlbFunctions.getServerGroups();
ctx.export("nlbServerGroupId1", ids.applyValue(getServerGroupsResult -> getServerGroupsResult.groups()[0].id()));
final var nameRegex = NlbFunctions.getServerGroups(GetServerGroupsArgs.builder()
.nameRegex("^my-ServerGroup")
.build());
ctx.export("nlbServerGroupId2", nameRegex.applyValue(getServerGroupsResult -> getServerGroupsResult.groups()[0].id()));
}
}
Content copied to clipboard
Return
A collection of values returned by getServerGroups.
Parameters
argument
A collection of arguments for invoking getServerGroups.
suspend fun getServerGroups(ids: List<String>? = null, nameRegex: String? = null, outputFile: String? = null, resourceGroupId: String? = null, serverGroupNames: List<String>? = null, serverGroupType: String? = null, status: String? = null, tags: Map<String, Any>? = null): GetServerGroupsResult
Return
A collection of values returned by getServerGroups.
See also
Parameters
ids
A list of Server Group IDs.
name Regex
A regex string to filter results by Server Group name.
output File
resource Group Id
The ID of the resource group to which the security group belongs.
server Group Names
The names of the server groups to be queried.
server Group Type
The type of the server group.
status
The status of the server group.
tags
A mapping of tags to assign to the resource.
suspend fun getServerGroups(argument: suspend GetServerGroupsPlainArgsBuilder.() -> Unit): GetServerGroupsResult
Return
A collection of values returned by getServerGroups.
See also
Parameters
argument
Builder for com.pulumi.alicloud.nlb.kotlin.inputs.GetServerGroupsPlainArgs.