1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. alb
  5. ServerGroup
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.alb.ServerGroup

Explore with Pulumi AI

Provides a Application Load Balancer (ALB) Server Group resource.

For information about Application Load Balancer (ALB) Server Group and how to use it, see What is Server Group.

NOTE: Available since v1.131.0.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const example = alicloud.resourcemanager.getResourceGroups({});
const exampleGetZones = alicloud.getZones({
    availableResourceCreation: "Instance",
});
const exampleGetInstanceTypes = exampleGetZones.then(exampleGetZones => alicloud.ecs.getInstanceTypes({
    availabilityZone: exampleGetZones.zones?.[0]?.id,
    cpuCoreCount: 1,
    memorySize: 2,
}));
const exampleGetImages = alicloud.ecs.getImages({
    nameRegex: "^ubuntu_18.*64",
    owners: "system",
});
const exampleNetwork = new alicloud.vpc.Network("example", {
    vpcName: name,
    cidrBlock: "10.4.0.0/16",
});
const exampleSwitch = new alicloud.vpc.Switch("example", {
    vswitchName: name,
    cidrBlock: "10.4.0.0/16",
    vpcId: exampleNetwork.id,
    zoneId: exampleGetZones.then(exampleGetZones => exampleGetZones.zones?.[0]?.id),
});
const exampleSecurityGroup = new alicloud.ecs.SecurityGroup("example", {
    name: name,
    description: name,
    vpcId: exampleNetwork.id,
});
const exampleInstance = new alicloud.ecs.Instance("example", {
    availabilityZone: exampleGetZones.then(exampleGetZones => exampleGetZones.zones?.[0]?.id),
    instanceName: name,
    imageId: exampleGetImages.then(exampleGetImages => exampleGetImages.images?.[0]?.id),
    instanceType: exampleGetInstanceTypes.then(exampleGetInstanceTypes => exampleGetInstanceTypes.instanceTypes?.[0]?.id),
    securityGroups: [exampleSecurityGroup.id],
    vswitchId: exampleSwitch.id,
});
const exampleServerGroup = new alicloud.alb.ServerGroup("example", {
    protocol: "HTTP",
    vpcId: exampleNetwork.id,
    serverGroupName: name,
    resourceGroupId: example.then(example => example.groups?.[0]?.id),
    stickySessionConfig: {
        stickySessionEnabled: true,
        cookie: "tf-example",
        stickySessionType: "Server",
    },
    healthCheckConfig: {
        healthCheckConnectPort: 46325,
        healthCheckEnabled: true,
        healthCheckHost: "tf-example.com",
        healthCheckCodes: [
            "http_2xx",
            "http_3xx",
            "http_4xx",
        ],
        healthCheckHttpVersion: "HTTP1.1",
        healthCheckInterval: 2,
        healthCheckMethod: "HEAD",
        healthCheckPath: "/tf-example",
        healthCheckProtocol: "HTTP",
        healthCheckTimeout: 5,
        healthyThreshold: 3,
        unhealthyThreshold: 3,
    },
    servers: [{
        description: name,
        port: 80,
        serverId: exampleInstance.id,
        serverIp: exampleInstance.privateIp,
        serverType: "Ecs",
        weight: 10,
    }],
    tags: {
        Created: "TF",
    },
});
Copy
import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "terraform-example"
example = alicloud.resourcemanager.get_resource_groups()
example_get_zones = alicloud.get_zones(available_resource_creation="Instance")
example_get_instance_types = alicloud.ecs.get_instance_types(availability_zone=example_get_zones.zones[0].id,
    cpu_core_count=1,
    memory_size=2)
example_get_images = alicloud.ecs.get_images(name_regex="^ubuntu_18.*64",
    owners="system")
example_network = alicloud.vpc.Network("example",
    vpc_name=name,
    cidr_block="10.4.0.0/16")
example_switch = alicloud.vpc.Switch("example",
    vswitch_name=name,
    cidr_block="10.4.0.0/16",
    vpc_id=example_network.id,
    zone_id=example_get_zones.zones[0].id)
example_security_group = alicloud.ecs.SecurityGroup("example",
    name=name,
    description=name,
    vpc_id=example_network.id)
example_instance = alicloud.ecs.Instance("example",
    availability_zone=example_get_zones.zones[0].id,
    instance_name=name,
    image_id=example_get_images.images[0].id,
    instance_type=example_get_instance_types.instance_types[0].id,
    security_groups=[example_security_group.id],
    vswitch_id=example_switch.id)
example_server_group = alicloud.alb.ServerGroup("example",
    protocol="HTTP",
    vpc_id=example_network.id,
    server_group_name=name,
    resource_group_id=example.groups[0].id,
    sticky_session_config={
        "sticky_session_enabled": True,
        "cookie": "tf-example",
        "sticky_session_type": "Server",
    },
    health_check_config={
        "health_check_connect_port": 46325,
        "health_check_enabled": True,
        "health_check_host": "tf-example.com",
        "health_check_codes": [
            "http_2xx",
            "http_3xx",
            "http_4xx",
        ],
        "health_check_http_version": "HTTP1.1",
        "health_check_interval": 2,
        "health_check_method": "HEAD",
        "health_check_path": "/tf-example",
        "health_check_protocol": "HTTP",
        "health_check_timeout": 5,
        "healthy_threshold": 3,
        "unhealthy_threshold": 3,
    },
    servers=[{
        "description": name,
        "port": 80,
        "server_id": example_instance.id,
        "server_ip": example_instance.private_ip,
        "server_type": "Ecs",
        "weight": 10,
    }],
    tags={
        "Created": "TF",
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/alb"
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/resourcemanager"
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		name := "terraform-example"
		if param := cfg.Get("name"); param != "" {
			name = param
		}
		example, err := resourcemanager.GetResourceGroups(ctx, &resourcemanager.GetResourceGroupsArgs{}, nil)
		if err != nil {
			return err
		}
		exampleGetZones, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
			AvailableResourceCreation: pulumi.StringRef("Instance"),
		}, nil)
		if err != nil {
			return err
		}
		exampleGetInstanceTypes, err := ecs.GetInstanceTypes(ctx, &ecs.GetInstanceTypesArgs{
			AvailabilityZone: pulumi.StringRef(exampleGetZones.Zones[0].Id),
			CpuCoreCount:     pulumi.IntRef(1),
			MemorySize:       pulumi.Float64Ref(2),
		}, nil)
		if err != nil {
			return err
		}
		exampleGetImages, err := ecs.GetImages(ctx, &ecs.GetImagesArgs{
			NameRegex: pulumi.StringRef("^ubuntu_18.*64"),
			Owners:    pulumi.StringRef("system"),
		}, nil)
		if err != nil {
			return err
		}
		exampleNetwork, err := vpc.NewNetwork(ctx, "example", &vpc.NetworkArgs{
			VpcName:   pulumi.String(name),
			CidrBlock: pulumi.String("10.4.0.0/16"),
		})
		if err != nil {
			return err
		}
		exampleSwitch, err := vpc.NewSwitch(ctx, "example", &vpc.SwitchArgs{
			VswitchName: pulumi.String(name),
			CidrBlock:   pulumi.String("10.4.0.0/16"),
			VpcId:       exampleNetwork.ID(),
			ZoneId:      pulumi.String(exampleGetZones.Zones[0].Id),
		})
		if err != nil {
			return err
		}
		exampleSecurityGroup, err := ecs.NewSecurityGroup(ctx, "example", &ecs.SecurityGroupArgs{
			Name:        pulumi.String(name),
			Description: pulumi.String(name),
			VpcId:       exampleNetwork.ID(),
		})
		if err != nil {
			return err
		}
		exampleInstance, err := ecs.NewInstance(ctx, "example", &ecs.InstanceArgs{
			AvailabilityZone: pulumi.String(exampleGetZones.Zones[0].Id),
			InstanceName:     pulumi.String(name),
			ImageId:          pulumi.String(exampleGetImages.Images[0].Id),
			InstanceType:     pulumi.String(exampleGetInstanceTypes.InstanceTypes[0].Id),
			SecurityGroups: pulumi.StringArray{
				exampleSecurityGroup.ID(),
			},
			VswitchId: exampleSwitch.ID(),
		})
		if err != nil {
			return err
		}
		_, err = alb.NewServerGroup(ctx, "example", &alb.ServerGroupArgs{
			Protocol:        pulumi.String("HTTP"),
			VpcId:           exampleNetwork.ID(),
			ServerGroupName: pulumi.String(name),
			ResourceGroupId: pulumi.String(example.Groups[0].Id),
			StickySessionConfig: &alb.ServerGroupStickySessionConfigArgs{
				StickySessionEnabled: pulumi.Bool(true),
				Cookie:               pulumi.String("tf-example"),
				StickySessionType:    pulumi.String("Server"),
			},
			HealthCheckConfig: &alb.ServerGroupHealthCheckConfigArgs{
				HealthCheckConnectPort: pulumi.Int(46325),
				HealthCheckEnabled:     pulumi.Bool(true),
				HealthCheckHost:        pulumi.String("tf-example.com"),
				HealthCheckCodes: pulumi.StringArray{
					pulumi.String("http_2xx"),
					pulumi.String("http_3xx"),
					pulumi.String("http_4xx"),
				},
				HealthCheckHttpVersion: pulumi.String("HTTP1.1"),
				HealthCheckInterval:    pulumi.Int(2),
				HealthCheckMethod:      pulumi.String("HEAD"),
				HealthCheckPath:        pulumi.String("/tf-example"),
				HealthCheckProtocol:    pulumi.String("HTTP"),
				HealthCheckTimeout:     pulumi.Int(5),
				HealthyThreshold:       pulumi.Int(3),
				UnhealthyThreshold:     pulumi.Int(3),
			},
			Servers: alb.ServerGroupServerArray{
				&alb.ServerGroupServerArgs{
					Description: pulumi.String(name),
					Port:        pulumi.Int(80),
					ServerId:    exampleInstance.ID(),
					ServerIp:    exampleInstance.PrivateIp,
					ServerType:  pulumi.String("Ecs"),
					Weight:      pulumi.Int(10),
				},
			},
			Tags: pulumi.StringMap{
				"Created": pulumi.String("TF"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var name = config.Get("name") ?? "terraform-example";
    var example = AliCloud.ResourceManager.GetResourceGroups.Invoke();

    var exampleGetZones = AliCloud.GetZones.Invoke(new()
    {
        AvailableResourceCreation = "Instance",
    });

    var exampleGetInstanceTypes = AliCloud.Ecs.GetInstanceTypes.Invoke(new()
    {
        AvailabilityZone = exampleGetZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
        CpuCoreCount = 1,
        MemorySize = 2,
    });

    var exampleGetImages = AliCloud.Ecs.GetImages.Invoke(new()
    {
        NameRegex = "^ubuntu_18.*64",
        Owners = "system",
    });

    var exampleNetwork = new AliCloud.Vpc.Network("example", new()
    {
        VpcName = name,
        CidrBlock = "10.4.0.0/16",
    });

    var exampleSwitch = new AliCloud.Vpc.Switch("example", new()
    {
        VswitchName = name,
        CidrBlock = "10.4.0.0/16",
        VpcId = exampleNetwork.Id,
        ZoneId = exampleGetZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
    });

    var exampleSecurityGroup = new AliCloud.Ecs.SecurityGroup("example", new()
    {
        Name = name,
        Description = name,
        VpcId = exampleNetwork.Id,
    });

    var exampleInstance = new AliCloud.Ecs.Instance("example", new()
    {
        AvailabilityZone = exampleGetZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
        InstanceName = name,
        ImageId = exampleGetImages.Apply(getImagesResult => getImagesResult.Images[0]?.Id),
        InstanceType = exampleGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.InstanceTypes[0]?.Id),
        SecurityGroups = new[]
        {
            exampleSecurityGroup.Id,
        },
        VswitchId = exampleSwitch.Id,
    });

    var exampleServerGroup = new AliCloud.Alb.ServerGroup("example", new()
    {
        Protocol = "HTTP",
        VpcId = exampleNetwork.Id,
        ServerGroupName = name,
        ResourceGroupId = example.Apply(getResourceGroupsResult => getResourceGroupsResult.Groups[0]?.Id),
        StickySessionConfig = new AliCloud.Alb.Inputs.ServerGroupStickySessionConfigArgs
        {
            StickySessionEnabled = true,
            Cookie = "tf-example",
            StickySessionType = "Server",
        },
        HealthCheckConfig = new AliCloud.Alb.Inputs.ServerGroupHealthCheckConfigArgs
        {
            HealthCheckConnectPort = 46325,
            HealthCheckEnabled = true,
            HealthCheckHost = "tf-example.com",
            HealthCheckCodes = new[]
            {
                "http_2xx",
                "http_3xx",
                "http_4xx",
            },
            HealthCheckHttpVersion = "HTTP1.1",
            HealthCheckInterval = 2,
            HealthCheckMethod = "HEAD",
            HealthCheckPath = "/tf-example",
            HealthCheckProtocol = "HTTP",
            HealthCheckTimeout = 5,
            HealthyThreshold = 3,
            UnhealthyThreshold = 3,
        },
        Servers = new[]
        {
            new AliCloud.Alb.Inputs.ServerGroupServerArgs
            {
                Description = name,
                Port = 80,
                ServerId = exampleInstance.Id,
                ServerIp = exampleInstance.PrivateIp,
                ServerType = "Ecs",
                Weight = 10,
            },
        },
        Tags = 
        {
            { "Created", "TF" },
        },
    });

});
Copy
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.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetZonesArgs;
import com.pulumi.alicloud.ecs.EcsFunctions;
import com.pulumi.alicloud.ecs.inputs.GetInstanceTypesArgs;
import com.pulumi.alicloud.ecs.inputs.GetImagesArgs;
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.ecs.SecurityGroup;
import com.pulumi.alicloud.ecs.SecurityGroupArgs;
import com.pulumi.alicloud.ecs.Instance;
import com.pulumi.alicloud.ecs.InstanceArgs;
import com.pulumi.alicloud.alb.ServerGroup;
import com.pulumi.alicloud.alb.ServerGroupArgs;
import com.pulumi.alicloud.alb.inputs.ServerGroupStickySessionConfigArgs;
import com.pulumi.alicloud.alb.inputs.ServerGroupHealthCheckConfigArgs;
import com.pulumi.alicloud.alb.inputs.ServerGroupServerArgs;
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("terraform-example");
        final var example = ResourcemanagerFunctions.getResourceGroups();

        final var exampleGetZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
            .availableResourceCreation("Instance")
            .build());

        final var exampleGetInstanceTypes = EcsFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
            .availabilityZone(exampleGetZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
            .cpuCoreCount(1)
            .memorySize(2)
            .build());

        final var exampleGetImages = EcsFunctions.getImages(GetImagesArgs.builder()
            .nameRegex("^ubuntu_18.*64")
            .owners("system")
            .build());

        var exampleNetwork = new Network("exampleNetwork", NetworkArgs.builder()
            .vpcName(name)
            .cidrBlock("10.4.0.0/16")
            .build());

        var exampleSwitch = new Switch("exampleSwitch", SwitchArgs.builder()
            .vswitchName(name)
            .cidrBlock("10.4.0.0/16")
            .vpcId(exampleNetwork.id())
            .zoneId(exampleGetZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
            .build());

        var exampleSecurityGroup = new SecurityGroup("exampleSecurityGroup", SecurityGroupArgs.builder()
            .name(name)
            .description(name)
            .vpcId(exampleNetwork.id())
            .build());

        var exampleInstance = new Instance("exampleInstance", InstanceArgs.builder()
            .availabilityZone(exampleGetZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
            .instanceName(name)
            .imageId(exampleGetImages.applyValue(getImagesResult -> getImagesResult.images()[0].id()))
            .instanceType(exampleGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.instanceTypes()[0].id()))
            .securityGroups(exampleSecurityGroup.id())
            .vswitchId(exampleSwitch.id())
            .build());

        var exampleServerGroup = new ServerGroup("exampleServerGroup", ServerGroupArgs.builder()
            .protocol("HTTP")
            .vpcId(exampleNetwork.id())
            .serverGroupName(name)
            .resourceGroupId(example.applyValue(getResourceGroupsResult -> getResourceGroupsResult.groups()[0].id()))
            .stickySessionConfig(ServerGroupStickySessionConfigArgs.builder()
                .stickySessionEnabled(true)
                .cookie("tf-example")
                .stickySessionType("Server")
                .build())
            .healthCheckConfig(ServerGroupHealthCheckConfigArgs.builder()
                .healthCheckConnectPort("46325")
                .healthCheckEnabled(true)
                .healthCheckHost("tf-example.com")
                .healthCheckCodes(                
                    "http_2xx",
                    "http_3xx",
                    "http_4xx")
                .healthCheckHttpVersion("HTTP1.1")
                .healthCheckInterval("2")
                .healthCheckMethod("HEAD")
                .healthCheckPath("/tf-example")
                .healthCheckProtocol("HTTP")
                .healthCheckTimeout(5)
                .healthyThreshold(3)
                .unhealthyThreshold(3)
                .build())
            .servers(ServerGroupServerArgs.builder()
                .description(name)
                .port(80)
                .serverId(exampleInstance.id())
                .serverIp(exampleInstance.privateIp())
                .serverType("Ecs")
                .weight(10)
                .build())
            .tags(Map.of("Created", "TF"))
            .build());

    }
}
Copy
configuration:
  name:
    type: string
    default: terraform-example
resources:
  exampleNetwork:
    type: alicloud:vpc:Network
    name: example
    properties:
      vpcName: ${name}
      cidrBlock: 10.4.0.0/16
  exampleSwitch:
    type: alicloud:vpc:Switch
    name: example
    properties:
      vswitchName: ${name}
      cidrBlock: 10.4.0.0/16
      vpcId: ${exampleNetwork.id}
      zoneId: ${exampleGetZones.zones[0].id}
  exampleSecurityGroup:
    type: alicloud:ecs:SecurityGroup
    name: example
    properties:
      name: ${name}
      description: ${name}
      vpcId: ${exampleNetwork.id}
  exampleInstance:
    type: alicloud:ecs:Instance
    name: example
    properties:
      availabilityZone: ${exampleGetZones.zones[0].id}
      instanceName: ${name}
      imageId: ${exampleGetImages.images[0].id}
      instanceType: ${exampleGetInstanceTypes.instanceTypes[0].id}
      securityGroups:
        - ${exampleSecurityGroup.id}
      vswitchId: ${exampleSwitch.id}
  exampleServerGroup:
    type: alicloud:alb:ServerGroup
    name: example
    properties:
      protocol: HTTP
      vpcId: ${exampleNetwork.id}
      serverGroupName: ${name}
      resourceGroupId: ${example.groups[0].id}
      stickySessionConfig:
        stickySessionEnabled: true
        cookie: tf-example
        stickySessionType: Server
      healthCheckConfig:
        healthCheckConnectPort: '46325'
        healthCheckEnabled: true
        healthCheckHost: tf-example.com
        healthCheckCodes:
          - http_2xx
          - http_3xx
          - http_4xx
        healthCheckHttpVersion: HTTP1.1
        healthCheckInterval: '2'
        healthCheckMethod: HEAD
        healthCheckPath: /tf-example
        healthCheckProtocol: HTTP
        healthCheckTimeout: 5
        healthyThreshold: 3
        unhealthyThreshold: 3
      servers:
        - description: ${name}
          port: 80
          serverId: ${exampleInstance.id}
          serverIp: ${exampleInstance.privateIp}
          serverType: Ecs
          weight: 10
      tags:
        Created: TF
variables:
  example:
    fn::invoke:
      function: alicloud:resourcemanager:getResourceGroups
      arguments: {}
  exampleGetZones:
    fn::invoke:
      function: alicloud:getZones
      arguments:
        availableResourceCreation: Instance
  exampleGetInstanceTypes:
    fn::invoke:
      function: alicloud:ecs:getInstanceTypes
      arguments:
        availabilityZone: ${exampleGetZones.zones[0].id}
        cpuCoreCount: 1
        memorySize: 2
  exampleGetImages:
    fn::invoke:
      function: alicloud:ecs:getImages
      arguments:
        nameRegex: ^ubuntu_18.*64
        owners: system
Copy

Create ServerGroup Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ServerGroup(name: string, args: ServerGroupArgs, opts?: CustomResourceOptions);
@overload
def ServerGroup(resource_name: str,
                args: ServerGroupArgs,
                opts: Optional[ResourceOptions] = None)

@overload
def ServerGroup(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                health_check_config: Optional[ServerGroupHealthCheckConfigArgs] = None,
                server_group_name: Optional[str] = None,
                scheduler: Optional[str] = None,
                servers: Optional[Sequence[ServerGroupServerArgs]] = None,
                health_check_template_id: Optional[str] = None,
                ipv6_enabled: Optional[bool] = None,
                protocol: Optional[str] = None,
                resource_group_id: Optional[str] = None,
                connection_drain_config: Optional[ServerGroupConnectionDrainConfigArgs] = None,
                cross_zone_enabled: Optional[bool] = None,
                server_group_type: Optional[str] = None,
                dry_run: Optional[bool] = None,
                service_name: Optional[str] = None,
                slow_start_config: Optional[ServerGroupSlowStartConfigArgs] = None,
                sticky_session_config: Optional[ServerGroupStickySessionConfigArgs] = None,
                tags: Optional[Mapping[str, str]] = None,
                uch_config: Optional[ServerGroupUchConfigArgs] = None,
                upstream_keepalive_enabled: Optional[bool] = None,
                vpc_id: Optional[str] = None)
func NewServerGroup(ctx *Context, name string, args ServerGroupArgs, opts ...ResourceOption) (*ServerGroup, error)
public ServerGroup(string name, ServerGroupArgs args, CustomResourceOptions? opts = null)
public ServerGroup(String name, ServerGroupArgs args)
public ServerGroup(String name, ServerGroupArgs args, CustomResourceOptions options)
type: alicloud:alb:ServerGroup
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ServerGroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ServerGroupArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ServerGroupArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ServerGroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ServerGroupArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var serverGroupResource = new AliCloud.Alb.ServerGroup("serverGroupResource", new()
{
    HealthCheckConfig = new AliCloud.Alb.Inputs.ServerGroupHealthCheckConfigArgs
    {
        HealthCheckEnabled = false,
        HealthCheckCodes = new[]
        {
            "string",
        },
        HealthCheckConnectPort = 0,
        HealthCheckHost = "string",
        HealthCheckHttpVersion = "string",
        HealthCheckInterval = 0,
        HealthCheckMethod = "string",
        HealthCheckPath = "string",
        HealthCheckProtocol = "string",
        HealthCheckTimeout = 0,
        HealthyThreshold = 0,
        UnhealthyThreshold = 0,
    },
    ServerGroupName = "string",
    Scheduler = "string",
    Servers = new[]
    {
        new AliCloud.Alb.Inputs.ServerGroupServerArgs
        {
            ServerId = "string",
            ServerType = "string",
            Description = "string",
            Port = 0,
            RemoteIpEnabled = false,
            ServerGroupId = "string",
            ServerIp = "string",
            Status = "string",
            Weight = 0,
        },
    },
    HealthCheckTemplateId = "string",
    Ipv6Enabled = false,
    Protocol = "string",
    ResourceGroupId = "string",
    ConnectionDrainConfig = new AliCloud.Alb.Inputs.ServerGroupConnectionDrainConfigArgs
    {
        ConnectionDrainEnabled = false,
        ConnectionDrainTimeout = 0,
    },
    CrossZoneEnabled = false,
    ServerGroupType = "string",
    DryRun = false,
    ServiceName = "string",
    SlowStartConfig = new AliCloud.Alb.Inputs.ServerGroupSlowStartConfigArgs
    {
        SlowStartDuration = 0,
        SlowStartEnabled = false,
    },
    StickySessionConfig = new AliCloud.Alb.Inputs.ServerGroupStickySessionConfigArgs
    {
        Cookie = "string",
        CookieTimeout = 0,
        StickySessionEnabled = false,
        StickySessionType = "string",
    },
    Tags = 
    {
        { "string", "string" },
    },
    UchConfig = new AliCloud.Alb.Inputs.ServerGroupUchConfigArgs
    {
        Type = "string",
        Value = "string",
    },
    UpstreamKeepaliveEnabled = false,
    VpcId = "string",
});
Copy
example, err := alb.NewServerGroup(ctx, "serverGroupResource", &alb.ServerGroupArgs{
	HealthCheckConfig: &alb.ServerGroupHealthCheckConfigArgs{
		HealthCheckEnabled: pulumi.Bool(false),
		HealthCheckCodes: pulumi.StringArray{
			pulumi.String("string"),
		},
		HealthCheckConnectPort: pulumi.Int(0),
		HealthCheckHost:        pulumi.String("string"),
		HealthCheckHttpVersion: pulumi.String("string"),
		HealthCheckInterval:    pulumi.Int(0),
		HealthCheckMethod:      pulumi.String("string"),
		HealthCheckPath:        pulumi.String("string"),
		HealthCheckProtocol:    pulumi.String("string"),
		HealthCheckTimeout:     pulumi.Int(0),
		HealthyThreshold:       pulumi.Int(0),
		UnhealthyThreshold:     pulumi.Int(0),
	},
	ServerGroupName: pulumi.String("string"),
	Scheduler:       pulumi.String("string"),
	Servers: alb.ServerGroupServerArray{
		&alb.ServerGroupServerArgs{
			ServerId:        pulumi.String("string"),
			ServerType:      pulumi.String("string"),
			Description:     pulumi.String("string"),
			Port:            pulumi.Int(0),
			RemoteIpEnabled: pulumi.Bool(false),
			ServerGroupId:   pulumi.String("string"),
			ServerIp:        pulumi.String("string"),
			Status:          pulumi.String("string"),
			Weight:          pulumi.Int(0),
		},
	},
	HealthCheckTemplateId: pulumi.String("string"),
	Ipv6Enabled:           pulumi.Bool(false),
	Protocol:              pulumi.String("string"),
	ResourceGroupId:       pulumi.String("string"),
	ConnectionDrainConfig: &alb.ServerGroupConnectionDrainConfigArgs{
		ConnectionDrainEnabled: pulumi.Bool(false),
		ConnectionDrainTimeout: pulumi.Int(0),
	},
	CrossZoneEnabled: pulumi.Bool(false),
	ServerGroupType:  pulumi.String("string"),
	DryRun:           pulumi.Bool(false),
	ServiceName:      pulumi.String("string"),
	SlowStartConfig: &alb.ServerGroupSlowStartConfigArgs{
		SlowStartDuration: pulumi.Int(0),
		SlowStartEnabled:  pulumi.Bool(false),
	},
	StickySessionConfig: &alb.ServerGroupStickySessionConfigArgs{
		Cookie:               pulumi.String("string"),
		CookieTimeout:        pulumi.Int(0),
		StickySessionEnabled: pulumi.Bool(false),
		StickySessionType:    pulumi.String("string"),
	},
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	UchConfig: &alb.ServerGroupUchConfigArgs{
		Type:  pulumi.String("string"),
		Value: pulumi.String("string"),
	},
	UpstreamKeepaliveEnabled: pulumi.Bool(false),
	VpcId:                    pulumi.String("string"),
})
Copy
var serverGroupResource = new com.pulumi.alicloud.alb.ServerGroup("serverGroupResource", com.pulumi.alicloud.alb.ServerGroupArgs.builder()
    .healthCheckConfig(ServerGroupHealthCheckConfigArgs.builder()
        .healthCheckEnabled(false)
        .healthCheckCodes("string")
        .healthCheckConnectPort(0)
        .healthCheckHost("string")
        .healthCheckHttpVersion("string")
        .healthCheckInterval(0)
        .healthCheckMethod("string")
        .healthCheckPath("string")
        .healthCheckProtocol("string")
        .healthCheckTimeout(0)
        .healthyThreshold(0)
        .unhealthyThreshold(0)
        .build())
    .serverGroupName("string")
    .scheduler("string")
    .servers(ServerGroupServerArgs.builder()
        .serverId("string")
        .serverType("string")
        .description("string")
        .port(0)
        .remoteIpEnabled(false)
        .serverGroupId("string")
        .serverIp("string")
        .status("string")
        .weight(0)
        .build())
    .healthCheckTemplateId("string")
    .ipv6Enabled(false)
    .protocol("string")
    .resourceGroupId("string")
    .connectionDrainConfig(ServerGroupConnectionDrainConfigArgs.builder()
        .connectionDrainEnabled(false)
        .connectionDrainTimeout(0)
        .build())
    .crossZoneEnabled(false)
    .serverGroupType("string")
    .dryRun(false)
    .serviceName("string")
    .slowStartConfig(ServerGroupSlowStartConfigArgs.builder()
        .slowStartDuration(0)
        .slowStartEnabled(false)
        .build())
    .stickySessionConfig(ServerGroupStickySessionConfigArgs.builder()
        .cookie("string")
        .cookieTimeout(0)
        .stickySessionEnabled(false)
        .stickySessionType("string")
        .build())
    .tags(Map.of("string", "string"))
    .uchConfig(ServerGroupUchConfigArgs.builder()
        .type("string")
        .value("string")
        .build())
    .upstreamKeepaliveEnabled(false)
    .vpcId("string")
    .build());
Copy
server_group_resource = alicloud.alb.ServerGroup("serverGroupResource",
    health_check_config={
        "health_check_enabled": False,
        "health_check_codes": ["string"],
        "health_check_connect_port": 0,
        "health_check_host": "string",
        "health_check_http_version": "string",
        "health_check_interval": 0,
        "health_check_method": "string",
        "health_check_path": "string",
        "health_check_protocol": "string",
        "health_check_timeout": 0,
        "healthy_threshold": 0,
        "unhealthy_threshold": 0,
    },
    server_group_name="string",
    scheduler="string",
    servers=[{
        "server_id": "string",
        "server_type": "string",
        "description": "string",
        "port": 0,
        "remote_ip_enabled": False,
        "server_group_id": "string",
        "server_ip": "string",
        "status": "string",
        "weight": 0,
    }],
    health_check_template_id="string",
    ipv6_enabled=False,
    protocol="string",
    resource_group_id="string",
    connection_drain_config={
        "connection_drain_enabled": False,
        "connection_drain_timeout": 0,
    },
    cross_zone_enabled=False,
    server_group_type="string",
    dry_run=False,
    service_name="string",
    slow_start_config={
        "slow_start_duration": 0,
        "slow_start_enabled": False,
    },
    sticky_session_config={
        "cookie": "string",
        "cookie_timeout": 0,
        "sticky_session_enabled": False,
        "sticky_session_type": "string",
    },
    tags={
        "string": "string",
    },
    uch_config={
        "type": "string",
        "value": "string",
    },
    upstream_keepalive_enabled=False,
    vpc_id="string")
Copy
const serverGroupResource = new alicloud.alb.ServerGroup("serverGroupResource", {
    healthCheckConfig: {
        healthCheckEnabled: false,
        healthCheckCodes: ["string"],
        healthCheckConnectPort: 0,
        healthCheckHost: "string",
        healthCheckHttpVersion: "string",
        healthCheckInterval: 0,
        healthCheckMethod: "string",
        healthCheckPath: "string",
        healthCheckProtocol: "string",
        healthCheckTimeout: 0,
        healthyThreshold: 0,
        unhealthyThreshold: 0,
    },
    serverGroupName: "string",
    scheduler: "string",
    servers: [{
        serverId: "string",
        serverType: "string",
        description: "string",
        port: 0,
        remoteIpEnabled: false,
        serverGroupId: "string",
        serverIp: "string",
        status: "string",
        weight: 0,
    }],
    healthCheckTemplateId: "string",
    ipv6Enabled: false,
    protocol: "string",
    resourceGroupId: "string",
    connectionDrainConfig: {
        connectionDrainEnabled: false,
        connectionDrainTimeout: 0,
    },
    crossZoneEnabled: false,
    serverGroupType: "string",
    dryRun: false,
    serviceName: "string",
    slowStartConfig: {
        slowStartDuration: 0,
        slowStartEnabled: false,
    },
    stickySessionConfig: {
        cookie: "string",
        cookieTimeout: 0,
        stickySessionEnabled: false,
        stickySessionType: "string",
    },
    tags: {
        string: "string",
    },
    uchConfig: {
        type: "string",
        value: "string",
    },
    upstreamKeepaliveEnabled: false,
    vpcId: "string",
});
Copy
type: alicloud:alb:ServerGroup
properties:
    connectionDrainConfig:
        connectionDrainEnabled: false
        connectionDrainTimeout: 0
    crossZoneEnabled: false
    dryRun: false
    healthCheckConfig:
        healthCheckCodes:
            - string
        healthCheckConnectPort: 0
        healthCheckEnabled: false
        healthCheckHost: string
        healthCheckHttpVersion: string
        healthCheckInterval: 0
        healthCheckMethod: string
        healthCheckPath: string
        healthCheckProtocol: string
        healthCheckTimeout: 0
        healthyThreshold: 0
        unhealthyThreshold: 0
    healthCheckTemplateId: string
    ipv6Enabled: false
    protocol: string
    resourceGroupId: string
    scheduler: string
    serverGroupName: string
    serverGroupType: string
    servers:
        - description: string
          port: 0
          remoteIpEnabled: false
          serverGroupId: string
          serverId: string
          serverIp: string
          serverType: string
          status: string
          weight: 0
    serviceName: string
    slowStartConfig:
        slowStartDuration: 0
        slowStartEnabled: false
    stickySessionConfig:
        cookie: string
        cookieTimeout: 0
        stickySessionEnabled: false
        stickySessionType: string
    tags:
        string: string
    uchConfig:
        type: string
        value: string
    upstreamKeepaliveEnabled: false
    vpcId: string
Copy

ServerGroup Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The ServerGroup resource accepts the following input properties:

HealthCheckConfig This property is required. Pulumi.AliCloud.Alb.Inputs.ServerGroupHealthCheckConfig
The configuration of health checks See health_check_config below.
ServerGroupName This property is required. string
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.
ConnectionDrainConfig Pulumi.AliCloud.Alb.Inputs.ServerGroupConnectionDrainConfig
Elegant interrupt configuration. See connection_drain_config below.
CrossZoneEnabled bool
Indicates whether cross-zone load balancing is enabled for the server group. Valid values:
DryRun bool
Whether to PreCheck only this request. Value: true: Send a check request, false (default): Send a normal request.
HealthCheckTemplateId string

The ID of the resource group to which you want to transfer the cloud resource.

NOTE: You can use resource groups to manage resources within your Alibaba Cloud account by group. This helps you resolve issues such as resource grouping and permission management for your Alibaba Cloud account. For more information, see What is resource management?

Ipv6Enabled Changes to this property will trigger replacement. bool
Enable Ipv6
Protocol Changes to this property will trigger replacement. string

The backend protocol. Valid values:

  • HTTP: allows you to associate an HTTPS, HTTP, or QUIC listener with the server group. This is the default value.

  • HTTPS: allows you to associate HTTPS listeners with backend servers.

  • gRPC: allows you to associate an HTTPS or QUIC listener with the server group.

NOTE: You do not need to specify a backend protocol if you set ServerGroupType to Fc.

ResourceGroupId string
Elegant interrupt configuration.
Scheduler string

The scheduling algorithm. Valid values:

  • Wrr (default): The weighted round-robin algorithm is used. Backend servers that have higher weights receive more requests than those that have lower weights.

  • Wlc: The weighted least connections algorithm is used. Requests are distributed based on the weights and the number of connections to backend servers. If two backend servers have the same weight, the backend server that has fewer connections is expected to receive more requests.

  • Sch: The consistent hashing algorithm is used. Requests from the same source IP address are distributed to the same backend server.

NOTE: This parameter takes effect when the ServerGroupType parameter is set to Instance or Ip.

ServerGroupType Changes to this property will trigger replacement. string
The type of server group. Valid values:

  • Instance (default): allows you to add servers by specifying Ecs, Eni, or Eci.
  • Ip: allows you to add servers by specifying IP addresses.
  • Fc: allows you to add servers by specifying functions of Function Compute.
Servers List<Pulumi.AliCloud.Alb.Inputs.ServerGroupServer>
List of servers. See servers below.
ServiceName string
Only applicable to the ALB Ingress scenario, indicating the K8s Service name corresponding to the server group.
SlowStartConfig Pulumi.AliCloud.Alb.Inputs.ServerGroupSlowStartConfig
Slow start configuration. See slow_start_config below.
StickySessionConfig Pulumi.AliCloud.Alb.Inputs.ServerGroupStickySessionConfig
The configuration of health checks See sticky_session_config below.
Tags Dictionary<string, string>
The creation time of the resource
UchConfig Pulumi.AliCloud.Alb.Inputs.ServerGroupUchConfig
Url consistency hash parameter configuration See uch_config below.
UpstreamKeepaliveEnabled bool
Specifies whether to enable persistent TCP connections.
VpcId Changes to this property will trigger replacement. string

The ID of the virtual private cloud (VPC). You can add only servers that are deployed in the specified VPC to the server group.

NOTE: This parameter takes effect when the ServerGroupType parameter is set to Instance or Ip.

HealthCheckConfig This property is required. ServerGroupHealthCheckConfigArgs
The configuration of health checks See health_check_config below.
ServerGroupName This property is required. string
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.
ConnectionDrainConfig ServerGroupConnectionDrainConfigArgs
Elegant interrupt configuration. See connection_drain_config below.
CrossZoneEnabled bool
Indicates whether cross-zone load balancing is enabled for the server group. Valid values:
DryRun bool
Whether to PreCheck only this request. Value: true: Send a check request, false (default): Send a normal request.
HealthCheckTemplateId string

The ID of the resource group to which you want to transfer the cloud resource.

NOTE: You can use resource groups to manage resources within your Alibaba Cloud account by group. This helps you resolve issues such as resource grouping and permission management for your Alibaba Cloud account. For more information, see What is resource management?

Ipv6Enabled Changes to this property will trigger replacement. bool
Enable Ipv6
Protocol Changes to this property will trigger replacement. string

The backend protocol. Valid values:

  • HTTP: allows you to associate an HTTPS, HTTP, or QUIC listener with the server group. This is the default value.

  • HTTPS: allows you to associate HTTPS listeners with backend servers.

  • gRPC: allows you to associate an HTTPS or QUIC listener with the server group.

NOTE: You do not need to specify a backend protocol if you set ServerGroupType to Fc.

ResourceGroupId string
Elegant interrupt configuration.
Scheduler string

The scheduling algorithm. Valid values:

  • Wrr (default): The weighted round-robin algorithm is used. Backend servers that have higher weights receive more requests than those that have lower weights.

  • Wlc: The weighted least connections algorithm is used. Requests are distributed based on the weights and the number of connections to backend servers. If two backend servers have the same weight, the backend server that has fewer connections is expected to receive more requests.

  • Sch: The consistent hashing algorithm is used. Requests from the same source IP address are distributed to the same backend server.

NOTE: This parameter takes effect when the ServerGroupType parameter is set to Instance or Ip.

ServerGroupType Changes to this property will trigger replacement. string
The type of server group. Valid values:

  • Instance (default): allows you to add servers by specifying Ecs, Eni, or Eci.
  • Ip: allows you to add servers by specifying IP addresses.
  • Fc: allows you to add servers by specifying functions of Function Compute.
Servers []ServerGroupServerArgs
List of servers. See servers below.
ServiceName string
Only applicable to the ALB Ingress scenario, indicating the K8s Service name corresponding to the server group.
SlowStartConfig ServerGroupSlowStartConfigArgs
Slow start configuration. See slow_start_config below.
StickySessionConfig ServerGroupStickySessionConfigArgs
The configuration of health checks See sticky_session_config below.
Tags map[string]string
The creation time of the resource
UchConfig ServerGroupUchConfigArgs
Url consistency hash parameter configuration See uch_config below.
UpstreamKeepaliveEnabled bool
Specifies whether to enable persistent TCP connections.
VpcId Changes to this property will trigger replacement. string

The ID of the virtual private cloud (VPC). You can add only servers that are deployed in the specified VPC to the server group.

NOTE: This parameter takes effect when the ServerGroupType parameter is set to Instance or Ip.

healthCheckConfig This property is required. ServerGroupHealthCheckConfig
The configuration of health checks See health_check_config below.
serverGroupName This property is required. String
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.
connectionDrainConfig ServerGroupConnectionDrainConfig
Elegant interrupt configuration. See connection_drain_config below.
crossZoneEnabled Boolean
Indicates whether cross-zone load balancing is enabled for the server group. Valid values:
dryRun Boolean
Whether to PreCheck only this request. Value: true: Send a check request, false (default): Send a normal request.
healthCheckTemplateId String

The ID of the resource group to which you want to transfer the cloud resource.

NOTE: You can use resource groups to manage resources within your Alibaba Cloud account by group. This helps you resolve issues such as resource grouping and permission management for your Alibaba Cloud account. For more information, see What is resource management?

ipv6Enabled Changes to this property will trigger replacement. Boolean
Enable Ipv6
protocol Changes to this property will trigger replacement. String

The backend protocol. Valid values:

  • HTTP: allows you to associate an HTTPS, HTTP, or QUIC listener with the server group. This is the default value.

  • HTTPS: allows you to associate HTTPS listeners with backend servers.

  • gRPC: allows you to associate an HTTPS or QUIC listener with the server group.

NOTE: You do not need to specify a backend protocol if you set ServerGroupType to Fc.

resourceGroupId String
Elegant interrupt configuration.
scheduler String

The scheduling algorithm. Valid values:

  • Wrr (default): The weighted round-robin algorithm is used. Backend servers that have higher weights receive more requests than those that have lower weights.

  • Wlc: The weighted least connections algorithm is used. Requests are distributed based on the weights and the number of connections to backend servers. If two backend servers have the same weight, the backend server that has fewer connections is expected to receive more requests.

  • Sch: The consistent hashing algorithm is used. Requests from the same source IP address are distributed to the same backend server.

NOTE: This parameter takes effect when the ServerGroupType parameter is set to Instance or Ip.

serverGroupType Changes to this property will trigger replacement. String
The type of server group. Valid values:

  • Instance (default): allows you to add servers by specifying Ecs, Eni, or Eci.
  • Ip: allows you to add servers by specifying IP addresses.
  • Fc: allows you to add servers by specifying functions of Function Compute.
servers List<ServerGroupServer>
List of servers. See servers below.
serviceName String
Only applicable to the ALB Ingress scenario, indicating the K8s Service name corresponding to the server group.
slowStartConfig ServerGroupSlowStartConfig
Slow start configuration. See slow_start_config below.
stickySessionConfig ServerGroupStickySessionConfig
The configuration of health checks See sticky_session_config below.
tags Map<String,String>
The creation time of the resource
uchConfig ServerGroupUchConfig
Url consistency hash parameter configuration See uch_config below.
upstreamKeepaliveEnabled Boolean
Specifies whether to enable persistent TCP connections.
vpcId Changes to this property will trigger replacement. String

The ID of the virtual private cloud (VPC). You can add only servers that are deployed in the specified VPC to the server group.

NOTE: This parameter takes effect when the ServerGroupType parameter is set to Instance or Ip.

healthCheckConfig This property is required. ServerGroupHealthCheckConfig
The configuration of health checks See health_check_config below.
serverGroupName This property is required. string
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.
connectionDrainConfig ServerGroupConnectionDrainConfig
Elegant interrupt configuration. See connection_drain_config below.
crossZoneEnabled boolean
Indicates whether cross-zone load balancing is enabled for the server group. Valid values:
dryRun boolean
Whether to PreCheck only this request. Value: true: Send a check request, false (default): Send a normal request.
healthCheckTemplateId string

The ID of the resource group to which you want to transfer the cloud resource.

NOTE: You can use resource groups to manage resources within your Alibaba Cloud account by group. This helps you resolve issues such as resource grouping and permission management for your Alibaba Cloud account. For more information, see What is resource management?

ipv6Enabled Changes to this property will trigger replacement. boolean
Enable Ipv6
protocol Changes to this property will trigger replacement. string

The backend protocol. Valid values:

  • HTTP: allows you to associate an HTTPS, HTTP, or QUIC listener with the server group. This is the default value.

  • HTTPS: allows you to associate HTTPS listeners with backend servers.

  • gRPC: allows you to associate an HTTPS or QUIC listener with the server group.

NOTE: You do not need to specify a backend protocol if you set ServerGroupType to Fc.

resourceGroupId string
Elegant interrupt configuration.
scheduler string

The scheduling algorithm. Valid values:

  • Wrr (default): The weighted round-robin algorithm is used. Backend servers that have higher weights receive more requests than those that have lower weights.

  • Wlc: The weighted least connections algorithm is used. Requests are distributed based on the weights and the number of connections to backend servers. If two backend servers have the same weight, the backend server that has fewer connections is expected to receive more requests.

  • Sch: The consistent hashing algorithm is used. Requests from the same source IP address are distributed to the same backend server.

NOTE: This parameter takes effect when the ServerGroupType parameter is set to Instance or Ip.

serverGroupType Changes to this property will trigger replacement. string
The type of server group. Valid values:

  • Instance (default): allows you to add servers by specifying Ecs, Eni, or Eci.
  • Ip: allows you to add servers by specifying IP addresses.
  • Fc: allows you to add servers by specifying functions of Function Compute.
servers ServerGroupServer[]
List of servers. See servers below.
serviceName string
Only applicable to the ALB Ingress scenario, indicating the K8s Service name corresponding to the server group.
slowStartConfig ServerGroupSlowStartConfig
Slow start configuration. See slow_start_config below.
stickySessionConfig ServerGroupStickySessionConfig
The configuration of health checks See sticky_session_config below.
tags {[key: string]: string}
The creation time of the resource
uchConfig ServerGroupUchConfig
Url consistency hash parameter configuration See uch_config below.
upstreamKeepaliveEnabled boolean
Specifies whether to enable persistent TCP connections.
vpcId Changes to this property will trigger replacement. string

The ID of the virtual private cloud (VPC). You can add only servers that are deployed in the specified VPC to the server group.

NOTE: This parameter takes effect when the ServerGroupType parameter is set to Instance or Ip.

health_check_config This property is required. ServerGroupHealthCheckConfigArgs
The configuration of health checks See health_check_config below.
server_group_name This property is required. str
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.
connection_drain_config ServerGroupConnectionDrainConfigArgs
Elegant interrupt configuration. See connection_drain_config below.
cross_zone_enabled bool
Indicates whether cross-zone load balancing is enabled for the server group. Valid values:
dry_run bool
Whether to PreCheck only this request. Value: true: Send a check request, false (default): Send a normal request.
health_check_template_id str

The ID of the resource group to which you want to transfer the cloud resource.

NOTE: You can use resource groups to manage resources within your Alibaba Cloud account by group. This helps you resolve issues such as resource grouping and permission management for your Alibaba Cloud account. For more information, see What is resource management?

ipv6_enabled Changes to this property will trigger replacement. bool
Enable Ipv6
protocol Changes to this property will trigger replacement. str

The backend protocol. Valid values:

  • HTTP: allows you to associate an HTTPS, HTTP, or QUIC listener with the server group. This is the default value.

  • HTTPS: allows you to associate HTTPS listeners with backend servers.

  • gRPC: allows you to associate an HTTPS or QUIC listener with the server group.

NOTE: You do not need to specify a backend protocol if you set ServerGroupType to Fc.

resource_group_id str
Elegant interrupt configuration.
scheduler str

The scheduling algorithm. Valid values:

  • Wrr (default): The weighted round-robin algorithm is used. Backend servers that have higher weights receive more requests than those that have lower weights.

  • Wlc: The weighted least connections algorithm is used. Requests are distributed based on the weights and the number of connections to backend servers. If two backend servers have the same weight, the backend server that has fewer connections is expected to receive more requests.

  • Sch: The consistent hashing algorithm is used. Requests from the same source IP address are distributed to the same backend server.

NOTE: This parameter takes effect when the ServerGroupType parameter is set to Instance or Ip.

server_group_type Changes to this property will trigger replacement. str
The type of server group. Valid values:

  • Instance (default): allows you to add servers by specifying Ecs, Eni, or Eci.
  • Ip: allows you to add servers by specifying IP addresses.
  • Fc: allows you to add servers by specifying functions of Function Compute.
servers Sequence[ServerGroupServerArgs]
List of servers. See servers below.
service_name str
Only applicable to the ALB Ingress scenario, indicating the K8s Service name corresponding to the server group.
slow_start_config ServerGroupSlowStartConfigArgs
Slow start configuration. See slow_start_config below.
sticky_session_config ServerGroupStickySessionConfigArgs
The configuration of health checks See sticky_session_config below.
tags Mapping[str, str]
The creation time of the resource
uch_config ServerGroupUchConfigArgs
Url consistency hash parameter configuration See uch_config below.
upstream_keepalive_enabled bool
Specifies whether to enable persistent TCP connections.
vpc_id Changes to this property will trigger replacement. str

The ID of the virtual private cloud (VPC). You can add only servers that are deployed in the specified VPC to the server group.

NOTE: This parameter takes effect when the ServerGroupType parameter is set to Instance or Ip.

healthCheckConfig This property is required. Property Map
The configuration of health checks See health_check_config below.
serverGroupName This property is required. String
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.
connectionDrainConfig Property Map
Elegant interrupt configuration. See connection_drain_config below.
crossZoneEnabled Boolean
Indicates whether cross-zone load balancing is enabled for the server group. Valid values:
dryRun Boolean
Whether to PreCheck only this request. Value: true: Send a check request, false (default): Send a normal request.
healthCheckTemplateId String

The ID of the resource group to which you want to transfer the cloud resource.

NOTE: You can use resource groups to manage resources within your Alibaba Cloud account by group. This helps you resolve issues such as resource grouping and permission management for your Alibaba Cloud account. For more information, see What is resource management?

ipv6Enabled Changes to this property will trigger replacement. Boolean
Enable Ipv6
protocol Changes to this property will trigger replacement. String

The backend protocol. Valid values:

  • HTTP: allows you to associate an HTTPS, HTTP, or QUIC listener with the server group. This is the default value.

  • HTTPS: allows you to associate HTTPS listeners with backend servers.

  • gRPC: allows you to associate an HTTPS or QUIC listener with the server group.

NOTE: You do not need to specify a backend protocol if you set ServerGroupType to Fc.

resourceGroupId String
Elegant interrupt configuration.
scheduler String

The scheduling algorithm. Valid values:

  • Wrr (default): The weighted round-robin algorithm is used. Backend servers that have higher weights receive more requests than those that have lower weights.

  • Wlc: The weighted least connections algorithm is used. Requests are distributed based on the weights and the number of connections to backend servers. If two backend servers have the same weight, the backend server that has fewer connections is expected to receive more requests.

  • Sch: The consistent hashing algorithm is used. Requests from the same source IP address are distributed to the same backend server.

NOTE: This parameter takes effect when the ServerGroupType parameter is set to Instance or Ip.

serverGroupType Changes to this property will trigger replacement. String
The type of server group. Valid values:

  • Instance (default): allows you to add servers by specifying Ecs, Eni, or Eci.
  • Ip: allows you to add servers by specifying IP addresses.
  • Fc: allows you to add servers by specifying functions of Function Compute.
servers List<Property Map>
List of servers. See servers below.
serviceName String
Only applicable to the ALB Ingress scenario, indicating the K8s Service name corresponding to the server group.
slowStartConfig Property Map
Slow start configuration. See slow_start_config below.
stickySessionConfig Property Map
The configuration of health checks See sticky_session_config below.
tags Map<String>
The creation time of the resource
uchConfig Property Map
Url consistency hash parameter configuration See uch_config below.
upstreamKeepaliveEnabled Boolean
Specifies whether to enable persistent TCP connections.
vpcId Changes to this property will trigger replacement. String

The ID of the virtual private cloud (VPC). You can add only servers that are deployed in the specified VPC to the server group.

NOTE: This parameter takes effect when the ServerGroupType parameter is set to Instance or Ip.

Outputs

All input properties are implicitly available as output properties. Additionally, the ServerGroup resource produces the following output properties:

CreateTime string
The creation time of the resource
Id string
The provider-assigned unique ID for this managed resource.
Status string
The status of the resource
CreateTime string
The creation time of the resource
Id string
The provider-assigned unique ID for this managed resource.
Status string
The status of the resource
createTime String
The creation time of the resource
id String
The provider-assigned unique ID for this managed resource.
status String
The status of the resource
createTime string
The creation time of the resource
id string
The provider-assigned unique ID for this managed resource.
status string
The status of the resource
create_time str
The creation time of the resource
id str
The provider-assigned unique ID for this managed resource.
status str
The status of the resource
createTime String
The creation time of the resource
id String
The provider-assigned unique ID for this managed resource.
status String
The status of the resource

Look up Existing ServerGroup Resource

Get an existing ServerGroup resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ServerGroupState, opts?: CustomResourceOptions): ServerGroup
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        connection_drain_config: Optional[ServerGroupConnectionDrainConfigArgs] = None,
        create_time: Optional[str] = None,
        cross_zone_enabled: Optional[bool] = None,
        dry_run: Optional[bool] = None,
        health_check_config: Optional[ServerGroupHealthCheckConfigArgs] = None,
        health_check_template_id: Optional[str] = None,
        ipv6_enabled: Optional[bool] = None,
        protocol: Optional[str] = None,
        resource_group_id: Optional[str] = None,
        scheduler: Optional[str] = None,
        server_group_name: Optional[str] = None,
        server_group_type: Optional[str] = None,
        servers: Optional[Sequence[ServerGroupServerArgs]] = None,
        service_name: Optional[str] = None,
        slow_start_config: Optional[ServerGroupSlowStartConfigArgs] = None,
        status: Optional[str] = None,
        sticky_session_config: Optional[ServerGroupStickySessionConfigArgs] = None,
        tags: Optional[Mapping[str, str]] = None,
        uch_config: Optional[ServerGroupUchConfigArgs] = None,
        upstream_keepalive_enabled: Optional[bool] = None,
        vpc_id: Optional[str] = None) -> ServerGroup
func GetServerGroup(ctx *Context, name string, id IDInput, state *ServerGroupState, opts ...ResourceOption) (*ServerGroup, error)
public static ServerGroup Get(string name, Input<string> id, ServerGroupState? state, CustomResourceOptions? opts = null)
public static ServerGroup get(String name, Output<String> id, ServerGroupState state, CustomResourceOptions options)
resources:  _:    type: alicloud:alb:ServerGroup    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
ConnectionDrainConfig Pulumi.AliCloud.Alb.Inputs.ServerGroupConnectionDrainConfig
Elegant interrupt configuration. See connection_drain_config below.
CreateTime string
The creation time of the resource
CrossZoneEnabled bool
Indicates whether cross-zone load balancing is enabled for the server group. Valid values:
DryRun bool
Whether to PreCheck only this request. Value: true: Send a check request, false (default): Send a normal request.
HealthCheckConfig Pulumi.AliCloud.Alb.Inputs.ServerGroupHealthCheckConfig
The configuration of health checks See health_check_config below.
HealthCheckTemplateId string

The ID of the resource group to which you want to transfer the cloud resource.

NOTE: You can use resource groups to manage resources within your Alibaba Cloud account by group. This helps you resolve issues such as resource grouping and permission management for your Alibaba Cloud account. For more information, see What is resource management?

Ipv6Enabled Changes to this property will trigger replacement. bool
Enable Ipv6
Protocol Changes to this property will trigger replacement. string

The backend protocol. Valid values:

  • HTTP: allows you to associate an HTTPS, HTTP, or QUIC listener with the server group. This is the default value.

  • HTTPS: allows you to associate HTTPS listeners with backend servers.

  • gRPC: allows you to associate an HTTPS or QUIC listener with the server group.

NOTE: You do not need to specify a backend protocol if you set ServerGroupType to Fc.

ResourceGroupId string
Elegant interrupt configuration.
Scheduler string

The scheduling algorithm. Valid values:

  • Wrr (default): The weighted round-robin algorithm is used. Backend servers that have higher weights receive more requests than those that have lower weights.

  • Wlc: The weighted least connections algorithm is used. Requests are distributed based on the weights and the number of connections to backend servers. If two backend servers have the same weight, the backend server that has fewer connections is expected to receive more requests.

  • Sch: The consistent hashing algorithm is used. Requests from the same source IP address are distributed to the same backend server.

NOTE: This parameter takes effect when the ServerGroupType parameter is set to Instance or Ip.

ServerGroupName string
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.
ServerGroupType Changes to this property will trigger replacement. string
The type of server group. Valid values:

  • Instance (default): allows you to add servers by specifying Ecs, Eni, or Eci.
  • Ip: allows you to add servers by specifying IP addresses.
  • Fc: allows you to add servers by specifying functions of Function Compute.
Servers List<Pulumi.AliCloud.Alb.Inputs.ServerGroupServer>
List of servers. See servers below.
ServiceName string
Only applicable to the ALB Ingress scenario, indicating the K8s Service name corresponding to the server group.
SlowStartConfig Pulumi.AliCloud.Alb.Inputs.ServerGroupSlowStartConfig
Slow start configuration. See slow_start_config below.
Status string
The status of the resource
StickySessionConfig Pulumi.AliCloud.Alb.Inputs.ServerGroupStickySessionConfig
The configuration of health checks See sticky_session_config below.
Tags Dictionary<string, string>
The creation time of the resource
UchConfig Pulumi.AliCloud.Alb.Inputs.ServerGroupUchConfig
Url consistency hash parameter configuration See uch_config below.
UpstreamKeepaliveEnabled bool
Specifies whether to enable persistent TCP connections.
VpcId Changes to this property will trigger replacement. string

The ID of the virtual private cloud (VPC). You can add only servers that are deployed in the specified VPC to the server group.

NOTE: This parameter takes effect when the ServerGroupType parameter is set to Instance or Ip.

ConnectionDrainConfig ServerGroupConnectionDrainConfigArgs
Elegant interrupt configuration. See connection_drain_config below.
CreateTime string
The creation time of the resource
CrossZoneEnabled bool
Indicates whether cross-zone load balancing is enabled for the server group. Valid values:
DryRun bool
Whether to PreCheck only this request. Value: true: Send a check request, false (default): Send a normal request.
HealthCheckConfig ServerGroupHealthCheckConfigArgs
The configuration of health checks See health_check_config below.
HealthCheckTemplateId string

The ID of the resource group to which you want to transfer the cloud resource.

NOTE: You can use resource groups to manage resources within your Alibaba Cloud account by group. This helps you resolve issues such as resource grouping and permission management for your Alibaba Cloud account. For more information, see What is resource management?

Ipv6Enabled Changes to this property will trigger replacement. bool
Enable Ipv6
Protocol Changes to this property will trigger replacement. string

The backend protocol. Valid values:

  • HTTP: allows you to associate an HTTPS, HTTP, or QUIC listener with the server group. This is the default value.

  • HTTPS: allows you to associate HTTPS listeners with backend servers.

  • gRPC: allows you to associate an HTTPS or QUIC listener with the server group.

NOTE: You do not need to specify a backend protocol if you set ServerGroupType to Fc.

ResourceGroupId string
Elegant interrupt configuration.
Scheduler string

The scheduling algorithm. Valid values:

  • Wrr (default): The weighted round-robin algorithm is used. Backend servers that have higher weights receive more requests than those that have lower weights.

  • Wlc: The weighted least connections algorithm is used. Requests are distributed based on the weights and the number of connections to backend servers. If two backend servers have the same weight, the backend server that has fewer connections is expected to receive more requests.

  • Sch: The consistent hashing algorithm is used. Requests from the same source IP address are distributed to the same backend server.

NOTE: This parameter takes effect when the ServerGroupType parameter is set to Instance or Ip.

ServerGroupName string
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.
ServerGroupType Changes to this property will trigger replacement. string
The type of server group. Valid values:

  • Instance (default): allows you to add servers by specifying Ecs, Eni, or Eci.
  • Ip: allows you to add servers by specifying IP addresses.
  • Fc: allows you to add servers by specifying functions of Function Compute.
Servers []ServerGroupServerArgs
List of servers. See servers below.
ServiceName string
Only applicable to the ALB Ingress scenario, indicating the K8s Service name corresponding to the server group.
SlowStartConfig ServerGroupSlowStartConfigArgs
Slow start configuration. See slow_start_config below.
Status string
The status of the resource
StickySessionConfig ServerGroupStickySessionConfigArgs
The configuration of health checks See sticky_session_config below.
Tags map[string]string
The creation time of the resource
UchConfig ServerGroupUchConfigArgs
Url consistency hash parameter configuration See uch_config below.
UpstreamKeepaliveEnabled bool
Specifies whether to enable persistent TCP connections.
VpcId Changes to this property will trigger replacement. string

The ID of the virtual private cloud (VPC). You can add only servers that are deployed in the specified VPC to the server group.

NOTE: This parameter takes effect when the ServerGroupType parameter is set to Instance or Ip.

connectionDrainConfig ServerGroupConnectionDrainConfig
Elegant interrupt configuration. See connection_drain_config below.
createTime String
The creation time of the resource
crossZoneEnabled Boolean
Indicates whether cross-zone load balancing is enabled for the server group. Valid values:
dryRun Boolean
Whether to PreCheck only this request. Value: true: Send a check request, false (default): Send a normal request.
healthCheckConfig ServerGroupHealthCheckConfig
The configuration of health checks See health_check_config below.
healthCheckTemplateId String

The ID of the resource group to which you want to transfer the cloud resource.

NOTE: You can use resource groups to manage resources within your Alibaba Cloud account by group. This helps you resolve issues such as resource grouping and permission management for your Alibaba Cloud account. For more information, see What is resource management?

ipv6Enabled Changes to this property will trigger replacement. Boolean
Enable Ipv6
protocol Changes to this property will trigger replacement. String

The backend protocol. Valid values:

  • HTTP: allows you to associate an HTTPS, HTTP, or QUIC listener with the server group. This is the default value.

  • HTTPS: allows you to associate HTTPS listeners with backend servers.

  • gRPC: allows you to associate an HTTPS or QUIC listener with the server group.

NOTE: You do not need to specify a backend protocol if you set ServerGroupType to Fc.

resourceGroupId String
Elegant interrupt configuration.
scheduler String

The scheduling algorithm. Valid values:

  • Wrr (default): The weighted round-robin algorithm is used. Backend servers that have higher weights receive more requests than those that have lower weights.

  • Wlc: The weighted least connections algorithm is used. Requests are distributed based on the weights and the number of connections to backend servers. If two backend servers have the same weight, the backend server that has fewer connections is expected to receive more requests.

  • Sch: The consistent hashing algorithm is used. Requests from the same source IP address are distributed to the same backend server.

NOTE: This parameter takes effect when the ServerGroupType parameter is set to Instance or Ip.

serverGroupName String
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.
serverGroupType Changes to this property will trigger replacement. String
The type of server group. Valid values:

  • Instance (default): allows you to add servers by specifying Ecs, Eni, or Eci.
  • Ip: allows you to add servers by specifying IP addresses.
  • Fc: allows you to add servers by specifying functions of Function Compute.
servers List<ServerGroupServer>
List of servers. See servers below.
serviceName String
Only applicable to the ALB Ingress scenario, indicating the K8s Service name corresponding to the server group.
slowStartConfig ServerGroupSlowStartConfig
Slow start configuration. See slow_start_config below.
status String
The status of the resource
stickySessionConfig ServerGroupStickySessionConfig
The configuration of health checks See sticky_session_config below.
tags Map<String,String>
The creation time of the resource
uchConfig ServerGroupUchConfig
Url consistency hash parameter configuration See uch_config below.
upstreamKeepaliveEnabled Boolean
Specifies whether to enable persistent TCP connections.
vpcId Changes to this property will trigger replacement. String

The ID of the virtual private cloud (VPC). You can add only servers that are deployed in the specified VPC to the server group.

NOTE: This parameter takes effect when the ServerGroupType parameter is set to Instance or Ip.

connectionDrainConfig ServerGroupConnectionDrainConfig
Elegant interrupt configuration. See connection_drain_config below.
createTime string
The creation time of the resource
crossZoneEnabled boolean
Indicates whether cross-zone load balancing is enabled for the server group. Valid values:
dryRun boolean
Whether to PreCheck only this request. Value: true: Send a check request, false (default): Send a normal request.
healthCheckConfig ServerGroupHealthCheckConfig
The configuration of health checks See health_check_config below.
healthCheckTemplateId string

The ID of the resource group to which you want to transfer the cloud resource.

NOTE: You can use resource groups to manage resources within your Alibaba Cloud account by group. This helps you resolve issues such as resource grouping and permission management for your Alibaba Cloud account. For more information, see What is resource management?

ipv6Enabled Changes to this property will trigger replacement. boolean
Enable Ipv6
protocol Changes to this property will trigger replacement. string

The backend protocol. Valid values:

  • HTTP: allows you to associate an HTTPS, HTTP, or QUIC listener with the server group. This is the default value.

  • HTTPS: allows you to associate HTTPS listeners with backend servers.

  • gRPC: allows you to associate an HTTPS or QUIC listener with the server group.

NOTE: You do not need to specify a backend protocol if you set ServerGroupType to Fc.

resourceGroupId string
Elegant interrupt configuration.
scheduler string

The scheduling algorithm. Valid values:

  • Wrr (default): The weighted round-robin algorithm is used. Backend servers that have higher weights receive more requests than those that have lower weights.

  • Wlc: The weighted least connections algorithm is used. Requests are distributed based on the weights and the number of connections to backend servers. If two backend servers have the same weight, the backend server that has fewer connections is expected to receive more requests.

  • Sch: The consistent hashing algorithm is used. Requests from the same source IP address are distributed to the same backend server.

NOTE: This parameter takes effect when the ServerGroupType parameter is set to Instance or Ip.

serverGroupName string
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.
serverGroupType Changes to this property will trigger replacement. string
The type of server group. Valid values:

  • Instance (default): allows you to add servers by specifying Ecs, Eni, or Eci.
  • Ip: allows you to add servers by specifying IP addresses.
  • Fc: allows you to add servers by specifying functions of Function Compute.
servers ServerGroupServer[]
List of servers. See servers below.
serviceName string
Only applicable to the ALB Ingress scenario, indicating the K8s Service name corresponding to the server group.
slowStartConfig ServerGroupSlowStartConfig
Slow start configuration. See slow_start_config below.
status string
The status of the resource
stickySessionConfig ServerGroupStickySessionConfig
The configuration of health checks See sticky_session_config below.
tags {[key: string]: string}
The creation time of the resource
uchConfig ServerGroupUchConfig
Url consistency hash parameter configuration See uch_config below.
upstreamKeepaliveEnabled boolean
Specifies whether to enable persistent TCP connections.
vpcId Changes to this property will trigger replacement. string

The ID of the virtual private cloud (VPC). You can add only servers that are deployed in the specified VPC to the server group.

NOTE: This parameter takes effect when the ServerGroupType parameter is set to Instance or Ip.

connection_drain_config ServerGroupConnectionDrainConfigArgs
Elegant interrupt configuration. See connection_drain_config below.
create_time str
The creation time of the resource
cross_zone_enabled bool
Indicates whether cross-zone load balancing is enabled for the server group. Valid values:
dry_run bool
Whether to PreCheck only this request. Value: true: Send a check request, false (default): Send a normal request.
health_check_config ServerGroupHealthCheckConfigArgs
The configuration of health checks See health_check_config below.
health_check_template_id str

The ID of the resource group to which you want to transfer the cloud resource.

NOTE: You can use resource groups to manage resources within your Alibaba Cloud account by group. This helps you resolve issues such as resource grouping and permission management for your Alibaba Cloud account. For more information, see What is resource management?

ipv6_enabled Changes to this property will trigger replacement. bool
Enable Ipv6
protocol Changes to this property will trigger replacement. str

The backend protocol. Valid values:

  • HTTP: allows you to associate an HTTPS, HTTP, or QUIC listener with the server group. This is the default value.

  • HTTPS: allows you to associate HTTPS listeners with backend servers.

  • gRPC: allows you to associate an HTTPS or QUIC listener with the server group.

NOTE: You do not need to specify a backend protocol if you set ServerGroupType to Fc.

resource_group_id str
Elegant interrupt configuration.
scheduler str

The scheduling algorithm. Valid values:

  • Wrr (default): The weighted round-robin algorithm is used. Backend servers that have higher weights receive more requests than those that have lower weights.

  • Wlc: The weighted least connections algorithm is used. Requests are distributed based on the weights and the number of connections to backend servers. If two backend servers have the same weight, the backend server that has fewer connections is expected to receive more requests.

  • Sch: The consistent hashing algorithm is used. Requests from the same source IP address are distributed to the same backend server.

NOTE: This parameter takes effect when the ServerGroupType parameter is set to Instance or Ip.

server_group_name str
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.
server_group_type Changes to this property will trigger replacement. str
The type of server group. Valid values:

  • Instance (default): allows you to add servers by specifying Ecs, Eni, or Eci.
  • Ip: allows you to add servers by specifying IP addresses.
  • Fc: allows you to add servers by specifying functions of Function Compute.
servers Sequence[ServerGroupServerArgs]
List of servers. See servers below.
service_name str
Only applicable to the ALB Ingress scenario, indicating the K8s Service name corresponding to the server group.
slow_start_config ServerGroupSlowStartConfigArgs
Slow start configuration. See slow_start_config below.
status str
The status of the resource
sticky_session_config ServerGroupStickySessionConfigArgs
The configuration of health checks See sticky_session_config below.
tags Mapping[str, str]
The creation time of the resource
uch_config ServerGroupUchConfigArgs
Url consistency hash parameter configuration See uch_config below.
upstream_keepalive_enabled bool
Specifies whether to enable persistent TCP connections.
vpc_id Changes to this property will trigger replacement. str

The ID of the virtual private cloud (VPC). You can add only servers that are deployed in the specified VPC to the server group.

NOTE: This parameter takes effect when the ServerGroupType parameter is set to Instance or Ip.

connectionDrainConfig Property Map
Elegant interrupt configuration. See connection_drain_config below.
createTime String
The creation time of the resource
crossZoneEnabled Boolean
Indicates whether cross-zone load balancing is enabled for the server group. Valid values:
dryRun Boolean
Whether to PreCheck only this request. Value: true: Send a check request, false (default): Send a normal request.
healthCheckConfig Property Map
The configuration of health checks See health_check_config below.
healthCheckTemplateId String

The ID of the resource group to which you want to transfer the cloud resource.

NOTE: You can use resource groups to manage resources within your Alibaba Cloud account by group. This helps you resolve issues such as resource grouping and permission management for your Alibaba Cloud account. For more information, see What is resource management?

ipv6Enabled Changes to this property will trigger replacement. Boolean
Enable Ipv6
protocol Changes to this property will trigger replacement. String

The backend protocol. Valid values:

  • HTTP: allows you to associate an HTTPS, HTTP, or QUIC listener with the server group. This is the default value.

  • HTTPS: allows you to associate HTTPS listeners with backend servers.

  • gRPC: allows you to associate an HTTPS or QUIC listener with the server group.

NOTE: You do not need to specify a backend protocol if you set ServerGroupType to Fc.

resourceGroupId String
Elegant interrupt configuration.
scheduler String

The scheduling algorithm. Valid values:

  • Wrr (default): The weighted round-robin algorithm is used. Backend servers that have higher weights receive more requests than those that have lower weights.

  • Wlc: The weighted least connections algorithm is used. Requests are distributed based on the weights and the number of connections to backend servers. If two backend servers have the same weight, the backend server that has fewer connections is expected to receive more requests.

  • Sch: The consistent hashing algorithm is used. Requests from the same source IP address are distributed to the same backend server.

NOTE: This parameter takes effect when the ServerGroupType parameter is set to Instance or Ip.

serverGroupName String
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.
serverGroupType Changes to this property will trigger replacement. String
The type of server group. Valid values:

  • Instance (default): allows you to add servers by specifying Ecs, Eni, or Eci.
  • Ip: allows you to add servers by specifying IP addresses.
  • Fc: allows you to add servers by specifying functions of Function Compute.
servers List<Property Map>
List of servers. See servers below.
serviceName String
Only applicable to the ALB Ingress scenario, indicating the K8s Service name corresponding to the server group.
slowStartConfig Property Map
Slow start configuration. See slow_start_config below.
status String
The status of the resource
stickySessionConfig Property Map
The configuration of health checks See sticky_session_config below.
tags Map<String>
The creation time of the resource
uchConfig Property Map
Url consistency hash parameter configuration See uch_config below.
upstreamKeepaliveEnabled Boolean
Specifies whether to enable persistent TCP connections.
vpcId Changes to this property will trigger replacement. String

The ID of the virtual private cloud (VPC). You can add only servers that are deployed in the specified VPC to the server group.

NOTE: This parameter takes effect when the ServerGroupType parameter is set to Instance or Ip.

Supporting Types

ServerGroupConnectionDrainConfig
, ServerGroupConnectionDrainConfigArgs

ConnectionDrainEnabled bool
Specifies whether to enable connection draining. Valid values:
ConnectionDrainTimeout int

The timeout period of connection draining.

Valid values: 0 to 900.

Default value: 300.

ConnectionDrainEnabled bool
Specifies whether to enable connection draining. Valid values:
ConnectionDrainTimeout int

The timeout period of connection draining.

Valid values: 0 to 900.

Default value: 300.

connectionDrainEnabled Boolean
Specifies whether to enable connection draining. Valid values:
connectionDrainTimeout Integer

The timeout period of connection draining.

Valid values: 0 to 900.

Default value: 300.

connectionDrainEnabled boolean
Specifies whether to enable connection draining. Valid values:
connectionDrainTimeout number

The timeout period of connection draining.

Valid values: 0 to 900.

Default value: 300.

connection_drain_enabled bool
Specifies whether to enable connection draining. Valid values:
connection_drain_timeout int

The timeout period of connection draining.

Valid values: 0 to 900.

Default value: 300.

connectionDrainEnabled Boolean
Specifies whether to enable connection draining. Valid values:
connectionDrainTimeout Number

The timeout period of connection draining.

Valid values: 0 to 900.

Default value: 300.

ServerGroupHealthCheckConfig
, ServerGroupHealthCheckConfigArgs

HealthCheckEnabled This property is required. bool
Specifies whether to enable the health check feature. Valid values:
HealthCheckCodes List<string>
The status code for a successful health check
HealthCheckConnectPort int

The backend port that is used for health checks.

Valid values: 0 to 65535.

If you set the value to 0, the backend port is used for health checks.

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true.

HealthCheckHost string

The domain name that is used for health checks.

  • Backend Server Internal IP (default): Use the internal IP address of backend servers as the health check domain name.

  • Custom Domain Name: Enter a domain name.

  • The domain name must be 1 to 80 characters in length.

  • The domain name can contain lowercase letters, digits, hyphens (-), and periods (.).

  • The domain name must contain at least one period (.) but cannot start or end with a period (.).

  • The rightmost domain label of the domain name can contain only letters, and cannot contain digits or hyphens (-).

  • The domain name cannot start or end with a hyphen (-).

NOTE: This parameter takes effect only if HealthCheckProtocol is set to HTTP, HTTPS, or gRPC.

HealthCheckHttpVersion string

The HTTP version that is used for health checks. Valid values:

  • HTTP1.0

  • HTTP1.1

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true and HealthCheckProtocol to HTTP or HTTPS.

HealthCheckInterval int

The interval at which health checks are performed. Unit: seconds.

Valid values: 1 to 50.

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true.

HealthCheckMethod string

The HTTP method that is used for health checks. Valid values:

  • GET: If the length of a response exceeds 8 KB, the response is truncated. However, the health check result is not affected.

  • POST: gRPC health checks use the POST method by default.

  • HEAD: HTTP and HTTPS health checks use the HEAD method by default.

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true and HealthCheckProtocol to HTTP, HTTPS, or gRPC.

HealthCheckPath string

The URL that is used for health checks.

The URL must be 1 to 80 characters in length, and can contain letters, digits, and the following special characters: - / . % ? # & =. It can also contain the following extended characters: _ ; ~ ! ( ) * [ ] @ $ ^ : ' , +. The URL must start with a forward slash (/).

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true and HealthCheckProtocol to HTTP or HTTPS.

HealthCheckProtocol string
The protocol that is used for health checks. Valid values:

  • HTTP: HTTP health checks simulate browser behaviors by sending HEAD or GET requests to probe the availability of backend servers.
  • HTTPS: HTTPS health checks simulate browser behaviors by sending HEAD or GET requests to probe the availability of backend servers. HTTPS provides higher security than HTTP because HTTPS supports data encryption.
  • TCP: TCP health checks send TCP SYN packets to a backend server to probe the availability of backend servers.
  • gRPC: gRPC health checks send POST or GET requests to a backend server to check whether the backend server is healthy.
HealthCheckTimeout int

The timeout period of a health check response. If a backend ECS instance does not respond within the specified timeout period, the ECS instance fails the health check. Unit: seconds.

Valid values: 1 to 300.

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true.

HealthyThreshold int

The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy. In this case, the health check status of the backend server changes from fail to success.

Valid values: 2 to 10.

Default value: 3.

UnhealthyThreshold int

The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy. In this case, the health check status of the backend server changes from success to fail.

Valid values: 2 to 10.

Default value: 3.

HealthCheckEnabled This property is required. bool
Specifies whether to enable the health check feature. Valid values:
HealthCheckCodes []string
The status code for a successful health check
HealthCheckConnectPort int

The backend port that is used for health checks.

Valid values: 0 to 65535.

If you set the value to 0, the backend port is used for health checks.

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true.

HealthCheckHost string

The domain name that is used for health checks.

  • Backend Server Internal IP (default): Use the internal IP address of backend servers as the health check domain name.

  • Custom Domain Name: Enter a domain name.

  • The domain name must be 1 to 80 characters in length.

  • The domain name can contain lowercase letters, digits, hyphens (-), and periods (.).

  • The domain name must contain at least one period (.) but cannot start or end with a period (.).

  • The rightmost domain label of the domain name can contain only letters, and cannot contain digits or hyphens (-).

  • The domain name cannot start or end with a hyphen (-).

NOTE: This parameter takes effect only if HealthCheckProtocol is set to HTTP, HTTPS, or gRPC.

HealthCheckHttpVersion string

The HTTP version that is used for health checks. Valid values:

  • HTTP1.0

  • HTTP1.1

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true and HealthCheckProtocol to HTTP or HTTPS.

HealthCheckInterval int

The interval at which health checks are performed. Unit: seconds.

Valid values: 1 to 50.

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true.

HealthCheckMethod string

The HTTP method that is used for health checks. Valid values:

  • GET: If the length of a response exceeds 8 KB, the response is truncated. However, the health check result is not affected.

  • POST: gRPC health checks use the POST method by default.

  • HEAD: HTTP and HTTPS health checks use the HEAD method by default.

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true and HealthCheckProtocol to HTTP, HTTPS, or gRPC.

HealthCheckPath string

The URL that is used for health checks.

The URL must be 1 to 80 characters in length, and can contain letters, digits, and the following special characters: - / . % ? # & =. It can also contain the following extended characters: _ ; ~ ! ( ) * [ ] @ $ ^ : ' , +. The URL must start with a forward slash (/).

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true and HealthCheckProtocol to HTTP or HTTPS.

HealthCheckProtocol string
The protocol that is used for health checks. Valid values:

  • HTTP: HTTP health checks simulate browser behaviors by sending HEAD or GET requests to probe the availability of backend servers.
  • HTTPS: HTTPS health checks simulate browser behaviors by sending HEAD or GET requests to probe the availability of backend servers. HTTPS provides higher security than HTTP because HTTPS supports data encryption.
  • TCP: TCP health checks send TCP SYN packets to a backend server to probe the availability of backend servers.
  • gRPC: gRPC health checks send POST or GET requests to a backend server to check whether the backend server is healthy.
HealthCheckTimeout int

The timeout period of a health check response. If a backend ECS instance does not respond within the specified timeout period, the ECS instance fails the health check. Unit: seconds.

Valid values: 1 to 300.

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true.

HealthyThreshold int

The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy. In this case, the health check status of the backend server changes from fail to success.

Valid values: 2 to 10.

Default value: 3.

UnhealthyThreshold int

The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy. In this case, the health check status of the backend server changes from success to fail.

Valid values: 2 to 10.

Default value: 3.

healthCheckEnabled This property is required. Boolean
Specifies whether to enable the health check feature. Valid values:
healthCheckCodes List<String>
The status code for a successful health check
healthCheckConnectPort Integer

The backend port that is used for health checks.

Valid values: 0 to 65535.

If you set the value to 0, the backend port is used for health checks.

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true.

healthCheckHost String

The domain name that is used for health checks.

  • Backend Server Internal IP (default): Use the internal IP address of backend servers as the health check domain name.

  • Custom Domain Name: Enter a domain name.

  • The domain name must be 1 to 80 characters in length.

  • The domain name can contain lowercase letters, digits, hyphens (-), and periods (.).

  • The domain name must contain at least one period (.) but cannot start or end with a period (.).

  • The rightmost domain label of the domain name can contain only letters, and cannot contain digits or hyphens (-).

  • The domain name cannot start or end with a hyphen (-).

NOTE: This parameter takes effect only if HealthCheckProtocol is set to HTTP, HTTPS, or gRPC.

healthCheckHttpVersion String

The HTTP version that is used for health checks. Valid values:

  • HTTP1.0

  • HTTP1.1

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true and HealthCheckProtocol to HTTP or HTTPS.

healthCheckInterval Integer

The interval at which health checks are performed. Unit: seconds.

Valid values: 1 to 50.

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true.

healthCheckMethod String

The HTTP method that is used for health checks. Valid values:

  • GET: If the length of a response exceeds 8 KB, the response is truncated. However, the health check result is not affected.

  • POST: gRPC health checks use the POST method by default.

  • HEAD: HTTP and HTTPS health checks use the HEAD method by default.

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true and HealthCheckProtocol to HTTP, HTTPS, or gRPC.

healthCheckPath String

The URL that is used for health checks.

The URL must be 1 to 80 characters in length, and can contain letters, digits, and the following special characters: - / . % ? # & =. It can also contain the following extended characters: _ ; ~ ! ( ) * [ ] @ $ ^ : ' , +. The URL must start with a forward slash (/).

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true and HealthCheckProtocol to HTTP or HTTPS.

healthCheckProtocol String
The protocol that is used for health checks. Valid values:

  • HTTP: HTTP health checks simulate browser behaviors by sending HEAD or GET requests to probe the availability of backend servers.
  • HTTPS: HTTPS health checks simulate browser behaviors by sending HEAD or GET requests to probe the availability of backend servers. HTTPS provides higher security than HTTP because HTTPS supports data encryption.
  • TCP: TCP health checks send TCP SYN packets to a backend server to probe the availability of backend servers.
  • gRPC: gRPC health checks send POST or GET requests to a backend server to check whether the backend server is healthy.
healthCheckTimeout Integer

The timeout period of a health check response. If a backend ECS instance does not respond within the specified timeout period, the ECS instance fails the health check. Unit: seconds.

Valid values: 1 to 300.

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true.

healthyThreshold Integer

The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy. In this case, the health check status of the backend server changes from fail to success.

Valid values: 2 to 10.

Default value: 3.

unhealthyThreshold Integer

The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy. In this case, the health check status of the backend server changes from success to fail.

Valid values: 2 to 10.

Default value: 3.

healthCheckEnabled This property is required. boolean
Specifies whether to enable the health check feature. Valid values:
healthCheckCodes string[]
The status code for a successful health check
healthCheckConnectPort number

The backend port that is used for health checks.

Valid values: 0 to 65535.

If you set the value to 0, the backend port is used for health checks.

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true.

healthCheckHost string

The domain name that is used for health checks.

  • Backend Server Internal IP (default): Use the internal IP address of backend servers as the health check domain name.

  • Custom Domain Name: Enter a domain name.

  • The domain name must be 1 to 80 characters in length.

  • The domain name can contain lowercase letters, digits, hyphens (-), and periods (.).

  • The domain name must contain at least one period (.) but cannot start or end with a period (.).

  • The rightmost domain label of the domain name can contain only letters, and cannot contain digits or hyphens (-).

  • The domain name cannot start or end with a hyphen (-).

NOTE: This parameter takes effect only if HealthCheckProtocol is set to HTTP, HTTPS, or gRPC.

healthCheckHttpVersion string

The HTTP version that is used for health checks. Valid values:

  • HTTP1.0

  • HTTP1.1

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true and HealthCheckProtocol to HTTP or HTTPS.

healthCheckInterval number

The interval at which health checks are performed. Unit: seconds.

Valid values: 1 to 50.

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true.

healthCheckMethod string

The HTTP method that is used for health checks. Valid values:

  • GET: If the length of a response exceeds 8 KB, the response is truncated. However, the health check result is not affected.

  • POST: gRPC health checks use the POST method by default.

  • HEAD: HTTP and HTTPS health checks use the HEAD method by default.

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true and HealthCheckProtocol to HTTP, HTTPS, or gRPC.

healthCheckPath string

The URL that is used for health checks.

The URL must be 1 to 80 characters in length, and can contain letters, digits, and the following special characters: - / . % ? # & =. It can also contain the following extended characters: _ ; ~ ! ( ) * [ ] @ $ ^ : ' , +. The URL must start with a forward slash (/).

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true and HealthCheckProtocol to HTTP or HTTPS.

healthCheckProtocol string
The protocol that is used for health checks. Valid values:

  • HTTP: HTTP health checks simulate browser behaviors by sending HEAD or GET requests to probe the availability of backend servers.
  • HTTPS: HTTPS health checks simulate browser behaviors by sending HEAD or GET requests to probe the availability of backend servers. HTTPS provides higher security than HTTP because HTTPS supports data encryption.
  • TCP: TCP health checks send TCP SYN packets to a backend server to probe the availability of backend servers.
  • gRPC: gRPC health checks send POST or GET requests to a backend server to check whether the backend server is healthy.
healthCheckTimeout number

The timeout period of a health check response. If a backend ECS instance does not respond within the specified timeout period, the ECS instance fails the health check. Unit: seconds.

Valid values: 1 to 300.

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true.

healthyThreshold number

The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy. In this case, the health check status of the backend server changes from fail to success.

Valid values: 2 to 10.

Default value: 3.

unhealthyThreshold number

The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy. In this case, the health check status of the backend server changes from success to fail.

Valid values: 2 to 10.

Default value: 3.

health_check_enabled This property is required. bool
Specifies whether to enable the health check feature. Valid values:
health_check_codes Sequence[str]
The status code for a successful health check
health_check_connect_port int

The backend port that is used for health checks.

Valid values: 0 to 65535.

If you set the value to 0, the backend port is used for health checks.

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true.

health_check_host str

The domain name that is used for health checks.

  • Backend Server Internal IP (default): Use the internal IP address of backend servers as the health check domain name.

  • Custom Domain Name: Enter a domain name.

  • The domain name must be 1 to 80 characters in length.

  • The domain name can contain lowercase letters, digits, hyphens (-), and periods (.).

  • The domain name must contain at least one period (.) but cannot start or end with a period (.).

  • The rightmost domain label of the domain name can contain only letters, and cannot contain digits or hyphens (-).

  • The domain name cannot start or end with a hyphen (-).

NOTE: This parameter takes effect only if HealthCheckProtocol is set to HTTP, HTTPS, or gRPC.

health_check_http_version str

The HTTP version that is used for health checks. Valid values:

  • HTTP1.0

  • HTTP1.1

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true and HealthCheckProtocol to HTTP or HTTPS.

health_check_interval int

The interval at which health checks are performed. Unit: seconds.

Valid values: 1 to 50.

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true.

health_check_method str

The HTTP method that is used for health checks. Valid values:

  • GET: If the length of a response exceeds 8 KB, the response is truncated. However, the health check result is not affected.

  • POST: gRPC health checks use the POST method by default.

  • HEAD: HTTP and HTTPS health checks use the HEAD method by default.

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true and HealthCheckProtocol to HTTP, HTTPS, or gRPC.

health_check_path str

The URL that is used for health checks.

The URL must be 1 to 80 characters in length, and can contain letters, digits, and the following special characters: - / . % ? # & =. It can also contain the following extended characters: _ ; ~ ! ( ) * [ ] @ $ ^ : ' , +. The URL must start with a forward slash (/).

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true and HealthCheckProtocol to HTTP or HTTPS.

health_check_protocol str
The protocol that is used for health checks. Valid values:

  • HTTP: HTTP health checks simulate browser behaviors by sending HEAD or GET requests to probe the availability of backend servers.
  • HTTPS: HTTPS health checks simulate browser behaviors by sending HEAD or GET requests to probe the availability of backend servers. HTTPS provides higher security than HTTP because HTTPS supports data encryption.
  • TCP: TCP health checks send TCP SYN packets to a backend server to probe the availability of backend servers.
  • gRPC: gRPC health checks send POST or GET requests to a backend server to check whether the backend server is healthy.
health_check_timeout int

The timeout period of a health check response. If a backend ECS instance does not respond within the specified timeout period, the ECS instance fails the health check. Unit: seconds.

Valid values: 1 to 300.

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true.

healthy_threshold int

The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy. In this case, the health check status of the backend server changes from fail to success.

Valid values: 2 to 10.

Default value: 3.

unhealthy_threshold int

The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy. In this case, the health check status of the backend server changes from success to fail.

Valid values: 2 to 10.

Default value: 3.

healthCheckEnabled This property is required. Boolean
Specifies whether to enable the health check feature. Valid values:
healthCheckCodes List<String>
The status code for a successful health check
healthCheckConnectPort Number

The backend port that is used for health checks.

Valid values: 0 to 65535.

If you set the value to 0, the backend port is used for health checks.

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true.

healthCheckHost String

The domain name that is used for health checks.

  • Backend Server Internal IP (default): Use the internal IP address of backend servers as the health check domain name.

  • Custom Domain Name: Enter a domain name.

  • The domain name must be 1 to 80 characters in length.

  • The domain name can contain lowercase letters, digits, hyphens (-), and periods (.).

  • The domain name must contain at least one period (.) but cannot start or end with a period (.).

  • The rightmost domain label of the domain name can contain only letters, and cannot contain digits or hyphens (-).

  • The domain name cannot start or end with a hyphen (-).

NOTE: This parameter takes effect only if HealthCheckProtocol is set to HTTP, HTTPS, or gRPC.

healthCheckHttpVersion String

The HTTP version that is used for health checks. Valid values:

  • HTTP1.0

  • HTTP1.1

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true and HealthCheckProtocol to HTTP or HTTPS.

healthCheckInterval Number

The interval at which health checks are performed. Unit: seconds.

Valid values: 1 to 50.

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true.

healthCheckMethod String

The HTTP method that is used for health checks. Valid values:

  • GET: If the length of a response exceeds 8 KB, the response is truncated. However, the health check result is not affected.

  • POST: gRPC health checks use the POST method by default.

  • HEAD: HTTP and HTTPS health checks use the HEAD method by default.

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true and HealthCheckProtocol to HTTP, HTTPS, or gRPC.

healthCheckPath String

The URL that is used for health checks.

The URL must be 1 to 80 characters in length, and can contain letters, digits, and the following special characters: - / . % ? # & =. It can also contain the following extended characters: _ ; ~ ! ( ) * [ ] @ $ ^ : ' , +. The URL must start with a forward slash (/).

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true and HealthCheckProtocol to HTTP or HTTPS.

healthCheckProtocol String
The protocol that is used for health checks. Valid values:

  • HTTP: HTTP health checks simulate browser behaviors by sending HEAD or GET requests to probe the availability of backend servers.
  • HTTPS: HTTPS health checks simulate browser behaviors by sending HEAD or GET requests to probe the availability of backend servers. HTTPS provides higher security than HTTP because HTTPS supports data encryption.
  • TCP: TCP health checks send TCP SYN packets to a backend server to probe the availability of backend servers.
  • gRPC: gRPC health checks send POST or GET requests to a backend server to check whether the backend server is healthy.
healthCheckTimeout Number

The timeout period of a health check response. If a backend ECS instance does not respond within the specified timeout period, the ECS instance fails the health check. Unit: seconds.

Valid values: 1 to 300.

NOTE: This parameter takes effect only if you set HealthCheckEnabled to true.

healthyThreshold Number

The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy. In this case, the health check status of the backend server changes from fail to success.

Valid values: 2 to 10.

Default value: 3.

unhealthyThreshold Number

The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy. In this case, the health check status of the backend server changes from success to fail.

Valid values: 2 to 10.

Default value: 3.

ServerGroupServer
, ServerGroupServerArgs

ServerId This property is required. string

The ID of the backend server. You can specify at most 200 servers in each call.

  • If the server group is of the Instance type, set ServerId to the ID of a resource of the Ecs, Eni, or Eci type.

  • If the server group is of the Ip type, set ServerId to IP addresses.

NOTE: You cannot perform this operation on a server group of the Function Compute type. You can call the ListServerGroups operation to query the type of server groups.

ServerType This property is required. string
The type of the backend server. You can specify at most 200 servers in each call. Default values:

  • Ecs: Elastic Compute Service (ECS) instance
  • Eni: elastic network interface (ENI)
  • Eci: elastic container instance
  • Ip: IP address
  • Fc: Function Compute
Description string
The description of the backend server. The description must be 2 to 256 characters in length, and cannot start with http:// or https://.
Port int

The port that is used by the backend server. Valid values: 1 to 65535. You can specify at most 200 servers in each call.

NOTE: This parameter is required if you set ServerType to Ecs, Eni, Eci, or Ip. You do not need to set this parameter if ServerType is set to Fc.

RemoteIpEnabled bool
Specifies whether to enable the remote IP feature. You can specify at most 200 servers in each call. Default values:
ServerGroupId string
The ID of the server group.
ServerIp string

The IP address of the backend server. You can specify at most 200 servers in each call.

NOTE: You do not need to set this parameter if you set ServerType to Fc.

Status string
The status of the resource
Weight int

The weight of the backend server. Valid values: 0 to 100. Default value: 100. If the value is set to 0, no requests are forwarded to the server. You can specify at most 200 servers in each call.

NOTE: You do not need to set this parameter if you set ServerType to Fc.

ServerId This property is required. string

The ID of the backend server. You can specify at most 200 servers in each call.

  • If the server group is of the Instance type, set ServerId to the ID of a resource of the Ecs, Eni, or Eci type.

  • If the server group is of the Ip type, set ServerId to IP addresses.

NOTE: You cannot perform this operation on a server group of the Function Compute type. You can call the ListServerGroups operation to query the type of server groups.

ServerType This property is required. string
The type of the backend server. You can specify at most 200 servers in each call. Default values:

  • Ecs: Elastic Compute Service (ECS) instance
  • Eni: elastic network interface (ENI)
  • Eci: elastic container instance
  • Ip: IP address
  • Fc: Function Compute
Description string
The description of the backend server. The description must be 2 to 256 characters in length, and cannot start with http:// or https://.
Port int

The port that is used by the backend server. Valid values: 1 to 65535. You can specify at most 200 servers in each call.

NOTE: This parameter is required if you set ServerType to Ecs, Eni, Eci, or Ip. You do not need to set this parameter if ServerType is set to Fc.

RemoteIpEnabled bool
Specifies whether to enable the remote IP feature. You can specify at most 200 servers in each call. Default values:
ServerGroupId string
The ID of the server group.
ServerIp string

The IP address of the backend server. You can specify at most 200 servers in each call.

NOTE: You do not need to set this parameter if you set ServerType to Fc.

Status string
The status of the resource
Weight int

The weight of the backend server. Valid values: 0 to 100. Default value: 100. If the value is set to 0, no requests are forwarded to the server. You can specify at most 200 servers in each call.

NOTE: You do not need to set this parameter if you set ServerType to Fc.

serverId This property is required. String

The ID of the backend server. You can specify at most 200 servers in each call.

  • If the server group is of the Instance type, set ServerId to the ID of a resource of the Ecs, Eni, or Eci type.

  • If the server group is of the Ip type, set ServerId to IP addresses.

NOTE: You cannot perform this operation on a server group of the Function Compute type. You can call the ListServerGroups operation to query the type of server groups.

serverType This property is required. String
The type of the backend server. You can specify at most 200 servers in each call. Default values:

  • Ecs: Elastic Compute Service (ECS) instance
  • Eni: elastic network interface (ENI)
  • Eci: elastic container instance
  • Ip: IP address
  • Fc: Function Compute
description String
The description of the backend server. The description must be 2 to 256 characters in length, and cannot start with http:// or https://.
port Integer

The port that is used by the backend server. Valid values: 1 to 65535. You can specify at most 200 servers in each call.

NOTE: This parameter is required if you set ServerType to Ecs, Eni, Eci, or Ip. You do not need to set this parameter if ServerType is set to Fc.

remoteIpEnabled Boolean
Specifies whether to enable the remote IP feature. You can specify at most 200 servers in each call. Default values:
serverGroupId String
The ID of the server group.
serverIp String

The IP address of the backend server. You can specify at most 200 servers in each call.

NOTE: You do not need to set this parameter if you set ServerType to Fc.

status String
The status of the resource
weight Integer

The weight of the backend server. Valid values: 0 to 100. Default value: 100. If the value is set to 0, no requests are forwarded to the server. You can specify at most 200 servers in each call.

NOTE: You do not need to set this parameter if you set ServerType to Fc.

serverId This property is required. string

The ID of the backend server. You can specify at most 200 servers in each call.

  • If the server group is of the Instance type, set ServerId to the ID of a resource of the Ecs, Eni, or Eci type.

  • If the server group is of the Ip type, set ServerId to IP addresses.

NOTE: You cannot perform this operation on a server group of the Function Compute type. You can call the ListServerGroups operation to query the type of server groups.

serverType This property is required. string
The type of the backend server. You can specify at most 200 servers in each call. Default values:

  • Ecs: Elastic Compute Service (ECS) instance
  • Eni: elastic network interface (ENI)
  • Eci: elastic container instance
  • Ip: IP address
  • Fc: Function Compute
description string
The description of the backend server. The description must be 2 to 256 characters in length, and cannot start with http:// or https://.
port number

The port that is used by the backend server. Valid values: 1 to 65535. You can specify at most 200 servers in each call.

NOTE: This parameter is required if you set ServerType to Ecs, Eni, Eci, or Ip. You do not need to set this parameter if ServerType is set to Fc.

remoteIpEnabled boolean
Specifies whether to enable the remote IP feature. You can specify at most 200 servers in each call. Default values:
serverGroupId string
The ID of the server group.
serverIp string

The IP address of the backend server. You can specify at most 200 servers in each call.

NOTE: You do not need to set this parameter if you set ServerType to Fc.

status string
The status of the resource
weight number

The weight of the backend server. Valid values: 0 to 100. Default value: 100. If the value is set to 0, no requests are forwarded to the server. You can specify at most 200 servers in each call.

NOTE: You do not need to set this parameter if you set ServerType to Fc.

server_id This property is required. str

The ID of the backend server. You can specify at most 200 servers in each call.

  • If the server group is of the Instance type, set ServerId to the ID of a resource of the Ecs, Eni, or Eci type.

  • If the server group is of the Ip type, set ServerId to IP addresses.

NOTE: You cannot perform this operation on a server group of the Function Compute type. You can call the ListServerGroups operation to query the type of server groups.

server_type This property is required. str
The type of the backend server. You can specify at most 200 servers in each call. Default values:

  • Ecs: Elastic Compute Service (ECS) instance
  • Eni: elastic network interface (ENI)
  • Eci: elastic container instance
  • Ip: IP address
  • Fc: Function Compute
description str
The description of the backend server. The description must be 2 to 256 characters in length, and cannot start with http:// or https://.
port int

The port that is used by the backend server. Valid values: 1 to 65535. You can specify at most 200 servers in each call.

NOTE: This parameter is required if you set ServerType to Ecs, Eni, Eci, or Ip. You do not need to set this parameter if ServerType is set to Fc.

remote_ip_enabled bool
Specifies whether to enable the remote IP feature. You can specify at most 200 servers in each call. Default values:
server_group_id str
The ID of the server group.
server_ip str

The IP address of the backend server. You can specify at most 200 servers in each call.

NOTE: You do not need to set this parameter if you set ServerType to Fc.

status str
The status of the resource
weight int

The weight of the backend server. Valid values: 0 to 100. Default value: 100. If the value is set to 0, no requests are forwarded to the server. You can specify at most 200 servers in each call.

NOTE: You do not need to set this parameter if you set ServerType to Fc.

serverId This property is required. String

The ID of the backend server. You can specify at most 200 servers in each call.

  • If the server group is of the Instance type, set ServerId to the ID of a resource of the Ecs, Eni, or Eci type.

  • If the server group is of the Ip type, set ServerId to IP addresses.

NOTE: You cannot perform this operation on a server group of the Function Compute type. You can call the ListServerGroups operation to query the type of server groups.

serverType This property is required. String
The type of the backend server. You can specify at most 200 servers in each call. Default values:

  • Ecs: Elastic Compute Service (ECS) instance
  • Eni: elastic network interface (ENI)
  • Eci: elastic container instance
  • Ip: IP address
  • Fc: Function Compute
description String
The description of the backend server. The description must be 2 to 256 characters in length, and cannot start with http:// or https://.
port Number

The port that is used by the backend server. Valid values: 1 to 65535. You can specify at most 200 servers in each call.

NOTE: This parameter is required if you set ServerType to Ecs, Eni, Eci, or Ip. You do not need to set this parameter if ServerType is set to Fc.

remoteIpEnabled Boolean
Specifies whether to enable the remote IP feature. You can specify at most 200 servers in each call. Default values:
serverGroupId String
The ID of the server group.
serverIp String

The IP address of the backend server. You can specify at most 200 servers in each call.

NOTE: You do not need to set this parameter if you set ServerType to Fc.

status String
The status of the resource
weight Number

The weight of the backend server. Valid values: 0 to 100. Default value: 100. If the value is set to 0, no requests are forwarded to the server. You can specify at most 200 servers in each call.

NOTE: You do not need to set this parameter if you set ServerType to Fc.

ServerGroupSlowStartConfig
, ServerGroupSlowStartConfigArgs

SlowStartDuration int

The duration of a slow start.

Valid values: 30 to 900.

Default value: 30.

SlowStartEnabled bool
Indicates whether slow starts are enabled. Valid values:
SlowStartDuration int

The duration of a slow start.

Valid values: 30 to 900.

Default value: 30.

SlowStartEnabled bool
Indicates whether slow starts are enabled. Valid values:
slowStartDuration Integer

The duration of a slow start.

Valid values: 30 to 900.

Default value: 30.

slowStartEnabled Boolean
Indicates whether slow starts are enabled. Valid values:
slowStartDuration number

The duration of a slow start.

Valid values: 30 to 900.

Default value: 30.

slowStartEnabled boolean
Indicates whether slow starts are enabled. Valid values:
slow_start_duration int

The duration of a slow start.

Valid values: 30 to 900.

Default value: 30.

slow_start_enabled bool
Indicates whether slow starts are enabled. Valid values:
slowStartDuration Number

The duration of a slow start.

Valid values: 30 to 900.

Default value: 30.

slowStartEnabled Boolean
Indicates whether slow starts are enabled. Valid values:

ServerGroupStickySessionConfig
, ServerGroupStickySessionConfigArgs

Cookie string

The cookie to be configured on the server.

The cookie must be 1 to 200 characters in length and can contain only ASCII characters and digits. It cannot contain commas (,), semicolons (;), or space characters. It cannot start with a dollar sign ($).

NOTE: This parameter takes effect when the StickySessionEnabled parameter is set to true and the StickySessionType parameter is set to Server.

CookieTimeout int

The maximum amount of time to wait before the session cookie expires. Unit: seconds.

Valid values: 1 to 86400.

Default value: 1000.

NOTE: This parameter takes effect only when StickySessionEnabled is set to true and StickySessionType is set to Insert.

StickySessionEnabled bool
Specifies whether to enable session persistence. Valid values:
StickySessionType string

The method that is used to handle a cookie. Valid values:

  • Insert: inserts a cookie.

ALB inserts a cookie (SERVERID) into the first HTTP or HTTPS response packet that is sent to a client. The next request from the client contains this cookie and the listener forwards this request to the recorded backend server.

  • Server: rewrites a cookie.

When ALB detects a user-defined cookie, it overwrites the original cookie with the user-defined cookie. Subsequent requests to ALB carry this user-defined cookie, and ALB determines the destination servers of the requests based on the cookies.

NOTE: This parameter takes effect when the StickySessionEnabled parameter is set to true for the server group.

Cookie string

The cookie to be configured on the server.

The cookie must be 1 to 200 characters in length and can contain only ASCII characters and digits. It cannot contain commas (,), semicolons (;), or space characters. It cannot start with a dollar sign ($).

NOTE: This parameter takes effect when the StickySessionEnabled parameter is set to true and the StickySessionType parameter is set to Server.

CookieTimeout int

The maximum amount of time to wait before the session cookie expires. Unit: seconds.

Valid values: 1 to 86400.

Default value: 1000.

NOTE: This parameter takes effect only when StickySessionEnabled is set to true and StickySessionType is set to Insert.

StickySessionEnabled bool
Specifies whether to enable session persistence. Valid values:
StickySessionType string

The method that is used to handle a cookie. Valid values:

  • Insert: inserts a cookie.

ALB inserts a cookie (SERVERID) into the first HTTP or HTTPS response packet that is sent to a client. The next request from the client contains this cookie and the listener forwards this request to the recorded backend server.

  • Server: rewrites a cookie.

When ALB detects a user-defined cookie, it overwrites the original cookie with the user-defined cookie. Subsequent requests to ALB carry this user-defined cookie, and ALB determines the destination servers of the requests based on the cookies.

NOTE: This parameter takes effect when the StickySessionEnabled parameter is set to true for the server group.

cookie String

The cookie to be configured on the server.

The cookie must be 1 to 200 characters in length and can contain only ASCII characters and digits. It cannot contain commas (,), semicolons (;), or space characters. It cannot start with a dollar sign ($).

NOTE: This parameter takes effect when the StickySessionEnabled parameter is set to true and the StickySessionType parameter is set to Server.

cookieTimeout Integer

The maximum amount of time to wait before the session cookie expires. Unit: seconds.

Valid values: 1 to 86400.

Default value: 1000.

NOTE: This parameter takes effect only when StickySessionEnabled is set to true and StickySessionType is set to Insert.

stickySessionEnabled Boolean
Specifies whether to enable session persistence. Valid values:
stickySessionType String

The method that is used to handle a cookie. Valid values:

  • Insert: inserts a cookie.

ALB inserts a cookie (SERVERID) into the first HTTP or HTTPS response packet that is sent to a client. The next request from the client contains this cookie and the listener forwards this request to the recorded backend server.

  • Server: rewrites a cookie.

When ALB detects a user-defined cookie, it overwrites the original cookie with the user-defined cookie. Subsequent requests to ALB carry this user-defined cookie, and ALB determines the destination servers of the requests based on the cookies.

NOTE: This parameter takes effect when the StickySessionEnabled parameter is set to true for the server group.

cookie string

The cookie to be configured on the server.

The cookie must be 1 to 200 characters in length and can contain only ASCII characters and digits. It cannot contain commas (,), semicolons (;), or space characters. It cannot start with a dollar sign ($).

NOTE: This parameter takes effect when the StickySessionEnabled parameter is set to true and the StickySessionType parameter is set to Server.

cookieTimeout number

The maximum amount of time to wait before the session cookie expires. Unit: seconds.

Valid values: 1 to 86400.

Default value: 1000.

NOTE: This parameter takes effect only when StickySessionEnabled is set to true and StickySessionType is set to Insert.

stickySessionEnabled boolean
Specifies whether to enable session persistence. Valid values:
stickySessionType string

The method that is used to handle a cookie. Valid values:

  • Insert: inserts a cookie.

ALB inserts a cookie (SERVERID) into the first HTTP or HTTPS response packet that is sent to a client. The next request from the client contains this cookie and the listener forwards this request to the recorded backend server.

  • Server: rewrites a cookie.

When ALB detects a user-defined cookie, it overwrites the original cookie with the user-defined cookie. Subsequent requests to ALB carry this user-defined cookie, and ALB determines the destination servers of the requests based on the cookies.

NOTE: This parameter takes effect when the StickySessionEnabled parameter is set to true for the server group.

cookie str

The cookie to be configured on the server.

The cookie must be 1 to 200 characters in length and can contain only ASCII characters and digits. It cannot contain commas (,), semicolons (;), or space characters. It cannot start with a dollar sign ($).

NOTE: This parameter takes effect when the StickySessionEnabled parameter is set to true and the StickySessionType parameter is set to Server.

cookie_timeout int

The maximum amount of time to wait before the session cookie expires. Unit: seconds.

Valid values: 1 to 86400.

Default value: 1000.

NOTE: This parameter takes effect only when StickySessionEnabled is set to true and StickySessionType is set to Insert.

sticky_session_enabled bool
Specifies whether to enable session persistence. Valid values:
sticky_session_type str

The method that is used to handle a cookie. Valid values:

  • Insert: inserts a cookie.

ALB inserts a cookie (SERVERID) into the first HTTP or HTTPS response packet that is sent to a client. The next request from the client contains this cookie and the listener forwards this request to the recorded backend server.

  • Server: rewrites a cookie.

When ALB detects a user-defined cookie, it overwrites the original cookie with the user-defined cookie. Subsequent requests to ALB carry this user-defined cookie, and ALB determines the destination servers of the requests based on the cookies.

NOTE: This parameter takes effect when the StickySessionEnabled parameter is set to true for the server group.

cookie String

The cookie to be configured on the server.

The cookie must be 1 to 200 characters in length and can contain only ASCII characters and digits. It cannot contain commas (,), semicolons (;), or space characters. It cannot start with a dollar sign ($).

NOTE: This parameter takes effect when the StickySessionEnabled parameter is set to true and the StickySessionType parameter is set to Server.

cookieTimeout Number

The maximum amount of time to wait before the session cookie expires. Unit: seconds.

Valid values: 1 to 86400.

Default value: 1000.

NOTE: This parameter takes effect only when StickySessionEnabled is set to true and StickySessionType is set to Insert.

stickySessionEnabled Boolean
Specifies whether to enable session persistence. Valid values:
stickySessionType String

The method that is used to handle a cookie. Valid values:

  • Insert: inserts a cookie.

ALB inserts a cookie (SERVERID) into the first HTTP or HTTPS response packet that is sent to a client. The next request from the client contains this cookie and the listener forwards this request to the recorded backend server.

  • Server: rewrites a cookie.

When ALB detects a user-defined cookie, it overwrites the original cookie with the user-defined cookie. Subsequent requests to ALB carry this user-defined cookie, and ALB determines the destination servers of the requests based on the cookies.

NOTE: This parameter takes effect when the StickySessionEnabled parameter is set to true for the server group.

ServerGroupUchConfig
, ServerGroupUchConfigArgs

Type string
The parameter type. Only QueryString can be filled.
Value string
Consistency hash parameter value
Type string
The parameter type. Only QueryString can be filled.
Value string
Consistency hash parameter value
type String
The parameter type. Only QueryString can be filled.
value String
Consistency hash parameter value
type string
The parameter type. Only QueryString can be filled.
value string
Consistency hash parameter value
type str
The parameter type. Only QueryString can be filled.
value str
Consistency hash parameter value
type String
The parameter type. Only QueryString can be filled.
value String
Consistency hash parameter value

Import

Application Load Balancer (ALB) Server Group can be imported using the id, e.g.

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

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.