ServerGroupArgs

data class ServerGroupArgs(val addressIpVersion: Output<String>? = null, val connectionDrain: Output<Boolean>? = null, val connectionDrainTimeout: Output<Int>? = null, val healthCheck: Output<ServerGroupHealthCheckArgs>? = null, val preserveClientIpEnabled: Output<Boolean>? = null, val protocol: Output<String>? = null, val resourceGroupId: Output<String>? = null, val scheduler: Output<String>? = null, val serverGroupName: Output<String>? = null, val serverGroupType: Output<String>? = null, val tags: Output<Map<String, Any>>? = null, val vpcId: Output<String>? = null) : ConvertibleToJava<ServerGroupArgs>

Provides a NLB Server Group resource. For information about NLB Server Group and how to use it, see What is Server Group.

NOTE: Available since 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.resourcemanager.ResourcemanagerFunctions;
import com.pulumi.alicloud.resourcemanager.inputs.GetResourceGroupsArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.nlb.ServerGroup;
import com.pulumi.alicloud.nlb.ServerGroupArgs;
import com.pulumi.alicloud.nlb.inputs.ServerGroupHealthCheckArgs;
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 config = ctx.config();
final var name = config.get("name").orElse("tf-example");
final var defaultResourceGroups = ResourcemanagerFunctions.getResourceGroups();
var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
.vpcName(name)
.cidrBlock("10.4.0.0/16")
.build());
var defaultServerGroup = new ServerGroup("defaultServerGroup", ServerGroupArgs.builder()
.resourceGroupId(defaultResourceGroups.applyValue(getResourceGroupsResult -> getResourceGroupsResult.ids()[0]))
.serverGroupName(name)
.serverGroupType("Instance")
.vpcId(defaultNetwork.id())
.scheduler("Wrr")
.protocol("TCP")
.connectionDrain(true)
.connectionDrainTimeout(60)
.addressIpVersion("Ipv4")
.healthCheck(ServerGroupHealthCheckArgs.builder()
.healthCheckEnabled(true)
.healthCheckType("TCP")
.healthCheckConnectPort(0)
.healthyThreshold(2)
.unhealthyThreshold(2)
.healthCheckConnectTimeout(5)
.healthCheckInterval(10)
.httpCheckMethod("GET")
.healthCheckHttpCodes(
"http_2xx",
"http_3xx",
"http_4xx")
.build())
.tags(Map.ofEntries(
Map.entry("Created", "TF"),
Map.entry("For", "example")
))
.build());
}
}

Import

NLB Server Group can be imported using the id, e.g.

$ pulumi import alicloud:nlb/serverGroup:ServerGroup example <id>

Constructors

Link copied to clipboard
fun ServerGroupArgs(addressIpVersion: Output<String>? = null, connectionDrain: Output<Boolean>? = null, connectionDrainTimeout: Output<Int>? = null, healthCheck: Output<ServerGroupHealthCheckArgs>? = null, preserveClientIpEnabled: Output<Boolean>? = null, protocol: Output<String>? = null, resourceGroupId: Output<String>? = null, scheduler: Output<String>? = null, serverGroupName: Output<String>? = null, serverGroupType: Output<String>? = null, tags: Output<Map<String, Any>>? = null, vpcId: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): ServerGroupArgs

Properties

Link copied to clipboard
val addressIpVersion: Output<String>? = null

The protocol version. Valid values: Ipv4 (default), DualStack.

Link copied to clipboard
val connectionDrain: Output<Boolean>? = null

Specifies whether to enable connection draining.

Link copied to clipboard
val connectionDrainTimeout: Output<Int>? = null

The timeout period of connection draining. Unit: seconds. Valid values: 10 to 900.

Link copied to clipboard

HealthCheck. See health_check below.

Link copied to clipboard
val preserveClientIpEnabled: Output<Boolean>? = null

Indicates whether client address retention is enabled.

Link copied to clipboard
val protocol: Output<String>? = null

The backend protocol. Valid values: TCP (default), UDP, and TCPSSL.

Link copied to clipboard
val resourceGroupId: Output<String>? = null

The ID of the resource group to which the security group belongs.

Link copied to clipboard
val scheduler: Output<String>? = null

The routing algorithm. Valid values:

Link copied to clipboard
val serverGroupName: Output<String>? = null

The name of the server group. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.

Link copied to clipboard
val serverGroupType: Output<String>? = null

The type of the server group. Valid values:

Link copied to clipboard
val tags: Output<Map<String, Any>>? = null

A mapping of tags to assign to the resource.

Link copied to clipboard
val vpcId: Output<String>? = null

The id of the vpc.