ServerGroupArgs

data class ServerGroupArgs(val deleteProtectionValidation: Output<Boolean>? = null, val loadBalancerId: Output<String>? = null, val name: Output<String>? = null, val servers: Output<List<ServerGroupServerArgs>>? = null) : ConvertibleToJava<ServerGroupArgs>

A virtual server group contains several ECS instances. The virtual server group can help you to define multiple listening dimension, and to meet the personalized requirements of domain name and URL forwarding.

NOTE: One ECS instance can be added into multiple virtual server groups. NOTE: One virtual server group can be attached with multiple listeners in one load balancer. NOTE: One Classic and Internet load balancer, its virtual server group can add Classic and VPC ECS instances. NOTE: One Classic and Intranet load balancer, its virtual server group can only add Classic ECS instances. NOTE: One VPC load balancer, its virtual server group can only add the same VPC ECS instances. For information about server group and how to use it, see Configure a server group.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetZonesArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.slb.ApplicationLoadBalancer;
import com.pulumi.alicloud.slb.ApplicationLoadBalancerArgs;
import com.pulumi.alicloud.slb.ServerGroup;
import com.pulumi.alicloud.slb.ServerGroupArgs;
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 slbServerGroupName = config.get("slbServerGroupName").orElse("forSlbServerGroup");
final var serverGroupZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
.availableResourceCreation("VSwitch")
.build());
var serverGroupNetwork = new Network("serverGroupNetwork", NetworkArgs.builder()
.vpcName(slbServerGroupName)
.cidrBlock("172.16.0.0/16")
.build());
var serverGroupSwitch = new Switch("serverGroupSwitch", SwitchArgs.builder()
.vpcId(serverGroupNetwork.id())
.cidrBlock("172.16.0.0/16")
.zoneId(serverGroupZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.vswitchName(slbServerGroupName)
.build());
var serverGroupApplicationLoadBalancer = new ApplicationLoadBalancer("serverGroupApplicationLoadBalancer", ApplicationLoadBalancerArgs.builder()
.loadBalancerName(slbServerGroupName)
.vswitchId(serverGroupSwitch.id())
.instanceChargeType("PayByCLCU")
.build());
var serverGroupServerGroup = new ServerGroup("serverGroupServerGroup", ServerGroupArgs.builder()
.loadBalancerId(serverGroupApplicationLoadBalancer.id())
.build());
}
}

Block servers

The servers mapping supports the following:

  • server_ids - (Required) A list backend server ID (ECS instance ID).

  • port - (Required) The port used by the backend server. Valid value range: 1-65535.

  • weight - (Optional) Weight of the backend server. Valid value range: 0-100. Default to 100.

  • type - (Optional, Available in 1.51.0+) Type of the backend server. Valid value ecs, eni. Default to eni.

Import

Load balancer backend server group can be imported using the id, e.g.

$ pulumi import alicloud:slb/serverGroup:ServerGroup example abc123456

Constructors

Link copied to clipboard
fun ServerGroupArgs(deleteProtectionValidation: Output<Boolean>? = null, loadBalancerId: Output<String>? = null, name: Output<String>? = null, servers: Output<List<ServerGroupServerArgs>>? = null)

Functions

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

Properties

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

Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.

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

The Load Balancer ID which is used to launch a new virtual server group.

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

Name of the virtual server group. Our plugin provides a default name: "tf-server-group".

Link copied to clipboard
val servers: Output<List<ServerGroupServerArgs>>? = null

A list of ECS instances to be added. NOTE: Field 'servers' has been deprecated from provider version 1.163.0 and it will be removed in the future version. Please use the new resource 'alicloud_slb_server_group_server_attachment'. At most 20 ECS instances can be supported in one resource. It contains three sub-fields as Block server follows.