1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. alb
  5. ServerGroup
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

alicloud.alb.ServerGroup

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

    Provides an ALB Server Group resource.

    For information about 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 exampleResourceGroups = alicloud.resourcemanager.getResourceGroups({});
    const exampleZones = alicloud.getZones({
        availableResourceCreation: "Instance",
    });
    const exampleInstanceTypes = exampleZones.then(exampleZones => alicloud.ecs.getInstanceTypes({
        availabilityZone: exampleZones.zones?.[0]?.id,
        cpuCoreCount: 1,
        memorySize: 2,
    }));
    const exampleImages = alicloud.ecs.getImages({
        nameRegex: "^ubuntu_[0-9]+_[0-9]+_x64*",
        owners: "system",
    });
    const exampleNetwork = new alicloud.vpc.Network("exampleNetwork", {
        vpcName: name,
        cidrBlock: "10.4.0.0/16",
    });
    const exampleSwitch = new alicloud.vpc.Switch("exampleSwitch", {
        vswitchName: name,
        cidrBlock: "10.4.0.0/16",
        vpcId: exampleNetwork.id,
        zoneId: exampleZones.then(exampleZones => exampleZones.zones?.[0]?.id),
    });
    const exampleSecurityGroup = new alicloud.ecs.SecurityGroup("exampleSecurityGroup", {
        description: name,
        vpcId: exampleNetwork.id,
    });
    const exampleInstance = new alicloud.ecs.Instance("exampleInstance", {
        availabilityZone: exampleZones.then(exampleZones => exampleZones.zones?.[0]?.id),
        instanceName: name,
        imageId: exampleImages.then(exampleImages => exampleImages.images?.[0]?.id),
        instanceType: exampleInstanceTypes.then(exampleInstanceTypes => exampleInstanceTypes.instanceTypes?.[0]?.id),
        securityGroups: [exampleSecurityGroup.id],
        vswitchId: exampleSwitch.id,
    });
    const exampleServerGroup = new alicloud.alb.ServerGroup("exampleServerGroup", {
        protocol: "HTTP",
        vpcId: exampleNetwork.id,
        serverGroupName: name,
        resourceGroupId: exampleResourceGroups.then(exampleResourceGroups => exampleResourceGroups.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",
        },
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    example_resource_groups = alicloud.resourcemanager.get_resource_groups()
    example_zones = alicloud.get_zones(available_resource_creation="Instance")
    example_instance_types = alicloud.ecs.get_instance_types(availability_zone=example_zones.zones[0].id,
        cpu_core_count=1,
        memory_size=2)
    example_images = alicloud.ecs.get_images(name_regex="^ubuntu_[0-9]+_[0-9]+_x64*",
        owners="system")
    example_network = alicloud.vpc.Network("exampleNetwork",
        vpc_name=name,
        cidr_block="10.4.0.0/16")
    example_switch = alicloud.vpc.Switch("exampleSwitch",
        vswitch_name=name,
        cidr_block="10.4.0.0/16",
        vpc_id=example_network.id,
        zone_id=example_zones.zones[0].id)
    example_security_group = alicloud.ecs.SecurityGroup("exampleSecurityGroup",
        description=name,
        vpc_id=example_network.id)
    example_instance = alicloud.ecs.Instance("exampleInstance",
        availability_zone=example_zones.zones[0].id,
        instance_name=name,
        image_id=example_images.images[0].id,
        instance_type=example_instance_types.instance_types[0].id,
        security_groups=[example_security_group.id],
        vswitch_id=example_switch.id)
    example_server_group = alicloud.alb.ServerGroup("exampleServerGroup",
        protocol="HTTP",
        vpc_id=example_network.id,
        server_group_name=name,
        resource_group_id=example_resource_groups.groups[0].id,
        sticky_session_config=alicloud.alb.ServerGroupStickySessionConfigArgs(
            sticky_session_enabled=True,
            cookie="tf-example",
            sticky_session_type="Server",
        ),
        health_check_config=alicloud.alb.ServerGroupHealthCheckConfigArgs(
            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=[alicloud.alb.ServerGroupServerArgs(
            description=name,
            port=80,
            server_id=example_instance.id,
            server_ip=example_instance.private_ip,
            server_type="Ecs",
            weight=10,
        )],
        tags={
            "Created": "TF",
        })
    
    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
    		}
    		exampleResourceGroups, err := resourcemanager.GetResourceGroups(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		exampleZones, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
    			AvailableResourceCreation: pulumi.StringRef("Instance"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		exampleInstanceTypes, err := ecs.GetInstanceTypes(ctx, &ecs.GetInstanceTypesArgs{
    			AvailabilityZone: pulumi.StringRef(exampleZones.Zones[0].Id),
    			CpuCoreCount:     pulumi.IntRef(1),
    			MemorySize:       pulumi.Float64Ref(2),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		exampleImages, err := ecs.GetImages(ctx, &ecs.GetImagesArgs{
    			NameRegex: pulumi.StringRef("^ubuntu_[0-9]+_[0-9]+_x64*"),
    			Owners:    pulumi.StringRef("system"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		exampleNetwork, err := vpc.NewNetwork(ctx, "exampleNetwork", &vpc.NetworkArgs{
    			VpcName:   pulumi.String(name),
    			CidrBlock: pulumi.String("10.4.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleSwitch, err := vpc.NewSwitch(ctx, "exampleSwitch", &vpc.SwitchArgs{
    			VswitchName: pulumi.String(name),
    			CidrBlock:   pulumi.String("10.4.0.0/16"),
    			VpcId:       exampleNetwork.ID(),
    			ZoneId:      pulumi.String(exampleZones.Zones[0].Id),
    		})
    		if err != nil {
    			return err
    		}
    		exampleSecurityGroup, err := ecs.NewSecurityGroup(ctx, "exampleSecurityGroup", &ecs.SecurityGroupArgs{
    			Description: pulumi.String(name),
    			VpcId:       exampleNetwork.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		exampleInstance, err := ecs.NewInstance(ctx, "exampleInstance", &ecs.InstanceArgs{
    			AvailabilityZone: pulumi.String(exampleZones.Zones[0].Id),
    			InstanceName:     pulumi.String(name),
    			ImageId:          pulumi.String(exampleImages.Images[0].Id),
    			InstanceType:     pulumi.String(exampleInstanceTypes.InstanceTypes[0].Id),
    			SecurityGroups: pulumi.StringArray{
    				exampleSecurityGroup.ID(),
    			},
    			VswitchId: exampleSwitch.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = alb.NewServerGroup(ctx, "exampleServerGroup", &alb.ServerGroupArgs{
    			Protocol:        pulumi.String("HTTP"),
    			VpcId:           exampleNetwork.ID(),
    			ServerGroupName: pulumi.String(name),
    			ResourceGroupId: pulumi.String(exampleResourceGroups.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.Map{
    				"Created": pulumi.Any("TF"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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 exampleResourceGroups = AliCloud.ResourceManager.GetResourceGroups.Invoke();
    
        var exampleZones = AliCloud.GetZones.Invoke(new()
        {
            AvailableResourceCreation = "Instance",
        });
    
        var exampleInstanceTypes = AliCloud.Ecs.GetInstanceTypes.Invoke(new()
        {
            AvailabilityZone = exampleZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
            CpuCoreCount = 1,
            MemorySize = 2,
        });
    
        var exampleImages = AliCloud.Ecs.GetImages.Invoke(new()
        {
            NameRegex = "^ubuntu_[0-9]+_[0-9]+_x64*",
            Owners = "system",
        });
    
        var exampleNetwork = new AliCloud.Vpc.Network("exampleNetwork", new()
        {
            VpcName = name,
            CidrBlock = "10.4.0.0/16",
        });
    
        var exampleSwitch = new AliCloud.Vpc.Switch("exampleSwitch", new()
        {
            VswitchName = name,
            CidrBlock = "10.4.0.0/16",
            VpcId = exampleNetwork.Id,
            ZoneId = exampleZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
        });
    
        var exampleSecurityGroup = new AliCloud.Ecs.SecurityGroup("exampleSecurityGroup", new()
        {
            Description = name,
            VpcId = exampleNetwork.Id,
        });
    
        var exampleInstance = new AliCloud.Ecs.Instance("exampleInstance", new()
        {
            AvailabilityZone = exampleZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
            InstanceName = name,
            ImageId = exampleImages.Apply(getImagesResult => getImagesResult.Images[0]?.Id),
            InstanceType = exampleInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.InstanceTypes[0]?.Id),
            SecurityGroups = new[]
            {
                exampleSecurityGroup.Id,
            },
            VswitchId = exampleSwitch.Id,
        });
    
        var exampleServerGroup = new AliCloud.Alb.ServerGroup("exampleServerGroup", new()
        {
            Protocol = "HTTP",
            VpcId = exampleNetwork.Id,
            ServerGroupName = name,
            ResourceGroupId = exampleResourceGroups.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" },
            },
        });
    
    });
    
    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 exampleResourceGroups = ResourcemanagerFunctions.getResourceGroups();
    
            final var exampleZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
                .availableResourceCreation("Instance")
                .build());
    
            final var exampleInstanceTypes = EcsFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
                .availabilityZone(exampleZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
                .cpuCoreCount(1)
                .memorySize(2)
                .build());
    
            final var exampleImages = EcsFunctions.getImages(GetImagesArgs.builder()
                .nameRegex("^ubuntu_[0-9]+_[0-9]+_x64*")
                .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(exampleZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
                .build());
    
            var exampleSecurityGroup = new SecurityGroup("exampleSecurityGroup", SecurityGroupArgs.builder()        
                .description(name)
                .vpcId(exampleNetwork.id())
                .build());
    
            var exampleInstance = new Instance("exampleInstance", InstanceArgs.builder()        
                .availabilityZone(exampleZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
                .instanceName(name)
                .imageId(exampleImages.applyValue(getImagesResult -> getImagesResult.images()[0].id()))
                .instanceType(exampleInstanceTypes.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(exampleResourceGroups.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());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      exampleNetwork:
        type: alicloud:vpc:Network
        properties:
          vpcName: ${name}
          cidrBlock: 10.4.0.0/16
      exampleSwitch:
        type: alicloud:vpc:Switch
        properties:
          vswitchName: ${name}
          cidrBlock: 10.4.0.0/16
          vpcId: ${exampleNetwork.id}
          zoneId: ${exampleZones.zones[0].id}
      exampleSecurityGroup:
        type: alicloud:ecs:SecurityGroup
        properties:
          description: ${name}
          vpcId: ${exampleNetwork.id}
      exampleInstance:
        type: alicloud:ecs:Instance
        properties:
          availabilityZone: ${exampleZones.zones[0].id}
          instanceName: ${name}
          imageId: ${exampleImages.images[0].id}
          instanceType: ${exampleInstanceTypes.instanceTypes[0].id}
          securityGroups:
            - ${exampleSecurityGroup.id}
          vswitchId: ${exampleSwitch.id}
      exampleServerGroup:
        type: alicloud:alb:ServerGroup
        properties:
          protocol: HTTP
          vpcId: ${exampleNetwork.id}
          serverGroupName: ${name}
          resourceGroupId: ${exampleResourceGroups.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:
      exampleResourceGroups:
        fn::invoke:
          Function: alicloud:resourcemanager:getResourceGroups
          Arguments: {}
      exampleZones:
        fn::invoke:
          Function: alicloud:getZones
          Arguments:
            availableResourceCreation: Instance
      exampleInstanceTypes:
        fn::invoke:
          Function: alicloud:ecs:getInstanceTypes
          Arguments:
            availabilityZone: ${exampleZones.zones[0].id}
            cpuCoreCount: 1
            memorySize: 2
      exampleImages:
        fn::invoke:
          Function: alicloud:ecs:getImages
          Arguments:
            nameRegex: ^ubuntu_[0-9]+_[0-9]+_x64*
            owners: system
    

    Create ServerGroup Resource

    new ServerGroup(name: string, args: ServerGroupArgs, opts?: CustomResourceOptions);
    @overload
    def ServerGroup(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    dry_run: Optional[bool] = None,
                    health_check_config: Optional[ServerGroupHealthCheckConfigArgs] = 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,
                    sticky_session_config: Optional[ServerGroupStickySessionConfigArgs] = None,
                    tags: Optional[Mapping[str, Any]] = None,
                    vpc_id: Optional[str] = None)
    @overload
    def ServerGroup(resource_name: str,
                    args: ServerGroupArgs,
                    opts: Optional[ResourceOptions] = 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.
    
    
    name string
    The unique name of the resource.
    args ServerGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args 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 string
    The unique name of the resource.
    args ServerGroupArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ServerGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ServerGroupArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    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

    The ServerGroup resource accepts the following input properties:

    HealthCheckConfig Pulumi.AliCloud.Alb.Inputs.ServerGroupHealthCheckConfig
    The configuration of health checks. See health_check_config below.
    ServerGroupName string
    The name of the server group.
    DryRun bool
    The dry run.
    Protocol string
    The server protocol. Valid values: HTTP, HTTPS, gRPC. While server_group_type is Fc this parameter will not take effect. From version 1.215.0, protocol can be set to gRPC.
    ResourceGroupId string
    The ID of the resource group.
    Scheduler string
    The scheduling algorithm. Valid values: Sch, Wlc, Wrr. NOTE: This parameter takes effect when the server_group_type parameter is set to Instance or Ip.
    ServerGroupType string
    The type of the server group. Default value: Instance. Valid values:
    Servers List<Pulumi.AliCloud.Alb.Inputs.ServerGroupServer>
    The backend servers. See servers below.
    StickySessionConfig Pulumi.AliCloud.Alb.Inputs.ServerGroupStickySessionConfig
    The configuration of session persistence. See sticky_session_config below.
    Tags Dictionary<string, object>
    A mapping of tags to assign to the resource.
    VpcId string
    The ID of the VPC that you want to access. NOTE: This parameter takes effect when the server_group_type parameter is set to Instance or Ip.
    HealthCheckConfig ServerGroupHealthCheckConfigArgs
    The configuration of health checks. See health_check_config below.
    ServerGroupName string
    The name of the server group.
    DryRun bool
    The dry run.
    Protocol string
    The server protocol. Valid values: HTTP, HTTPS, gRPC. While server_group_type is Fc this parameter will not take effect. From version 1.215.0, protocol can be set to gRPC.
    ResourceGroupId string
    The ID of the resource group.
    Scheduler string
    The scheduling algorithm. Valid values: Sch, Wlc, Wrr. NOTE: This parameter takes effect when the server_group_type parameter is set to Instance or Ip.
    ServerGroupType string
    The type of the server group. Default value: Instance. Valid values:
    Servers []ServerGroupServerArgs
    The backend servers. See servers below.
    StickySessionConfig ServerGroupStickySessionConfigArgs
    The configuration of session persistence. See sticky_session_config below.
    Tags map[string]interface{}
    A mapping of tags to assign to the resource.
    VpcId string
    The ID of the VPC that you want to access. NOTE: This parameter takes effect when the server_group_type parameter is set to Instance or Ip.
    healthCheckConfig ServerGroupHealthCheckConfig
    The configuration of health checks. See health_check_config below.
    serverGroupName String
    The name of the server group.
    dryRun Boolean
    The dry run.
    protocol String
    The server protocol. Valid values: HTTP, HTTPS, gRPC. While server_group_type is Fc this parameter will not take effect. From version 1.215.0, protocol can be set to gRPC.
    resourceGroupId String
    The ID of the resource group.
    scheduler String
    The scheduling algorithm. Valid values: Sch, Wlc, Wrr. NOTE: This parameter takes effect when the server_group_type parameter is set to Instance or Ip.
    serverGroupType String
    The type of the server group. Default value: Instance. Valid values:
    servers List<ServerGroupServer>
    The backend servers. See servers below.
    stickySessionConfig ServerGroupStickySessionConfig
    The configuration of session persistence. See sticky_session_config below.
    tags Map<String,Object>
    A mapping of tags to assign to the resource.
    vpcId String
    The ID of the VPC that you want to access. NOTE: This parameter takes effect when the server_group_type parameter is set to Instance or Ip.
    healthCheckConfig ServerGroupHealthCheckConfig
    The configuration of health checks. See health_check_config below.
    serverGroupName string
    The name of the server group.
    dryRun boolean
    The dry run.
    protocol string
    The server protocol. Valid values: HTTP, HTTPS, gRPC. While server_group_type is Fc this parameter will not take effect. From version 1.215.0, protocol can be set to gRPC.
    resourceGroupId string
    The ID of the resource group.
    scheduler string
    The scheduling algorithm. Valid values: Sch, Wlc, Wrr. NOTE: This parameter takes effect when the server_group_type parameter is set to Instance or Ip.
    serverGroupType string
    The type of the server group. Default value: Instance. Valid values:
    servers ServerGroupServer[]
    The backend servers. See servers below.
    stickySessionConfig ServerGroupStickySessionConfig
    The configuration of session persistence. See sticky_session_config below.
    tags {[key: string]: any}
    A mapping of tags to assign to the resource.
    vpcId string
    The ID of the VPC that you want to access. NOTE: This parameter takes effect when the server_group_type parameter is set to Instance or Ip.
    health_check_config ServerGroupHealthCheckConfigArgs
    The configuration of health checks. See health_check_config below.
    server_group_name str
    The name of the server group.
    dry_run bool
    The dry run.
    protocol str
    The server protocol. Valid values: HTTP, HTTPS, gRPC. While server_group_type is Fc this parameter will not take effect. From version 1.215.0, protocol can be set to gRPC.
    resource_group_id str
    The ID of the resource group.
    scheduler str
    The scheduling algorithm. Valid values: Sch, Wlc, Wrr. NOTE: This parameter takes effect when the server_group_type parameter is set to Instance or Ip.
    server_group_type str
    The type of the server group. Default value: Instance. Valid values:
    servers Sequence[ServerGroupServerArgs]
    The backend servers. See servers below.
    sticky_session_config ServerGroupStickySessionConfigArgs
    The configuration of session persistence. See sticky_session_config below.
    tags Mapping[str, Any]
    A mapping of tags to assign to the resource.
    vpc_id str
    The ID of the VPC that you want to access. NOTE: This parameter takes effect when the server_group_type parameter is set to Instance or Ip.
    healthCheckConfig Property Map
    The configuration of health checks. See health_check_config below.
    serverGroupName String
    The name of the server group.
    dryRun Boolean
    The dry run.
    protocol String
    The server protocol. Valid values: HTTP, HTTPS, gRPC. While server_group_type is Fc this parameter will not take effect. From version 1.215.0, protocol can be set to gRPC.
    resourceGroupId String
    The ID of the resource group.
    scheduler String
    The scheduling algorithm. Valid values: Sch, Wlc, Wrr. NOTE: This parameter takes effect when the server_group_type parameter is set to Instance or Ip.
    serverGroupType String
    The type of the server group. Default value: Instance. Valid values:
    servers List<Property Map>
    The backend servers. See servers below.
    stickySessionConfig Property Map
    The configuration of session persistence. See sticky_session_config below.
    tags Map<Any>
    A mapping of tags to assign to the resource.
    vpcId String
    The ID of the VPC that you want to access. NOTE: This parameter takes effect when the server_group_type 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:

    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the backend server.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the backend server.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the backend server.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The status of the backend server.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The status of the backend server.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the backend server.

    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,
            dry_run: Optional[bool] = None,
            health_check_config: Optional[ServerGroupHealthCheckConfigArgs] = 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,
            status: Optional[str] = None,
            sticky_session_config: Optional[ServerGroupStickySessionConfigArgs] = None,
            tags: Optional[Mapping[str, Any]] = 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)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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:
    DryRun bool
    The dry run.
    HealthCheckConfig Pulumi.AliCloud.Alb.Inputs.ServerGroupHealthCheckConfig
    The configuration of health checks. See health_check_config below.
    Protocol string
    The server protocol. Valid values: HTTP, HTTPS, gRPC. While server_group_type is Fc this parameter will not take effect. From version 1.215.0, protocol can be set to gRPC.
    ResourceGroupId string
    The ID of the resource group.
    Scheduler string
    The scheduling algorithm. Valid values: Sch, Wlc, Wrr. NOTE: This parameter takes effect when the server_group_type parameter is set to Instance or Ip.
    ServerGroupName string
    The name of the server group.
    ServerGroupType string
    The type of the server group. Default value: Instance. Valid values:
    Servers List<Pulumi.AliCloud.Alb.Inputs.ServerGroupServer>
    The backend servers. See servers below.
    Status string
    The status of the backend server.
    StickySessionConfig Pulumi.AliCloud.Alb.Inputs.ServerGroupStickySessionConfig
    The configuration of session persistence. See sticky_session_config below.
    Tags Dictionary<string, object>
    A mapping of tags to assign to the resource.
    VpcId string
    The ID of the VPC that you want to access. NOTE: This parameter takes effect when the server_group_type parameter is set to Instance or Ip.
    DryRun bool
    The dry run.
    HealthCheckConfig ServerGroupHealthCheckConfigArgs
    The configuration of health checks. See health_check_config below.
    Protocol string
    The server protocol. Valid values: HTTP, HTTPS, gRPC. While server_group_type is Fc this parameter will not take effect. From version 1.215.0, protocol can be set to gRPC.
    ResourceGroupId string
    The ID of the resource group.
    Scheduler string
    The scheduling algorithm. Valid values: Sch, Wlc, Wrr. NOTE: This parameter takes effect when the server_group_type parameter is set to Instance or Ip.
    ServerGroupName string
    The name of the server group.
    ServerGroupType string
    The type of the server group. Default value: Instance. Valid values:
    Servers []ServerGroupServerArgs
    The backend servers. See servers below.
    Status string
    The status of the backend server.
    StickySessionConfig ServerGroupStickySessionConfigArgs
    The configuration of session persistence. See sticky_session_config below.
    Tags map[string]interface{}
    A mapping of tags to assign to the resource.
    VpcId string
    The ID of the VPC that you want to access. NOTE: This parameter takes effect when the server_group_type parameter is set to Instance or Ip.
    dryRun Boolean
    The dry run.
    healthCheckConfig ServerGroupHealthCheckConfig
    The configuration of health checks. See health_check_config below.
    protocol String
    The server protocol. Valid values: HTTP, HTTPS, gRPC. While server_group_type is Fc this parameter will not take effect. From version 1.215.0, protocol can be set to gRPC.
    resourceGroupId String
    The ID of the resource group.
    scheduler String
    The scheduling algorithm. Valid values: Sch, Wlc, Wrr. NOTE: This parameter takes effect when the server_group_type parameter is set to Instance or Ip.
    serverGroupName String
    The name of the server group.
    serverGroupType String
    The type of the server group. Default value: Instance. Valid values:
    servers List<ServerGroupServer>
    The backend servers. See servers below.
    status String
    The status of the backend server.
    stickySessionConfig ServerGroupStickySessionConfig
    The configuration of session persistence. See sticky_session_config below.
    tags Map<String,Object>
    A mapping of tags to assign to the resource.
    vpcId String
    The ID of the VPC that you want to access. NOTE: This parameter takes effect when the server_group_type parameter is set to Instance or Ip.
    dryRun boolean
    The dry run.
    healthCheckConfig ServerGroupHealthCheckConfig
    The configuration of health checks. See health_check_config below.
    protocol string
    The server protocol. Valid values: HTTP, HTTPS, gRPC. While server_group_type is Fc this parameter will not take effect. From version 1.215.0, protocol can be set to gRPC.
    resourceGroupId string
    The ID of the resource group.
    scheduler string
    The scheduling algorithm. Valid values: Sch, Wlc, Wrr. NOTE: This parameter takes effect when the server_group_type parameter is set to Instance or Ip.
    serverGroupName string
    The name of the server group.
    serverGroupType string
    The type of the server group. Default value: Instance. Valid values:
    servers ServerGroupServer[]
    The backend servers. See servers below.
    status string
    The status of the backend server.
    stickySessionConfig ServerGroupStickySessionConfig
    The configuration of session persistence. See sticky_session_config below.
    tags {[key: string]: any}
    A mapping of tags to assign to the resource.
    vpcId string
    The ID of the VPC that you want to access. NOTE: This parameter takes effect when the server_group_type parameter is set to Instance or Ip.
    dry_run bool
    The dry run.
    health_check_config ServerGroupHealthCheckConfigArgs
    The configuration of health checks. See health_check_config below.
    protocol str
    The server protocol. Valid values: HTTP, HTTPS, gRPC. While server_group_type is Fc this parameter will not take effect. From version 1.215.0, protocol can be set to gRPC.
    resource_group_id str
    The ID of the resource group.
    scheduler str
    The scheduling algorithm. Valid values: Sch, Wlc, Wrr. NOTE: This parameter takes effect when the server_group_type parameter is set to Instance or Ip.
    server_group_name str
    The name of the server group.
    server_group_type str
    The type of the server group. Default value: Instance. Valid values:
    servers Sequence[ServerGroupServerArgs]
    The backend servers. See servers below.
    status str
    The status of the backend server.
    sticky_session_config ServerGroupStickySessionConfigArgs
    The configuration of session persistence. See sticky_session_config below.
    tags Mapping[str, Any]
    A mapping of tags to assign to the resource.
    vpc_id str
    The ID of the VPC that you want to access. NOTE: This parameter takes effect when the server_group_type parameter is set to Instance or Ip.
    dryRun Boolean
    The dry run.
    healthCheckConfig Property Map
    The configuration of health checks. See health_check_config below.
    protocol String
    The server protocol. Valid values: HTTP, HTTPS, gRPC. While server_group_type is Fc this parameter will not take effect. From version 1.215.0, protocol can be set to gRPC.
    resourceGroupId String
    The ID of the resource group.
    scheduler String
    The scheduling algorithm. Valid values: Sch, Wlc, Wrr. NOTE: This parameter takes effect when the server_group_type parameter is set to Instance or Ip.
    serverGroupName String
    The name of the server group.
    serverGroupType String
    The type of the server group. Default value: Instance. Valid values:
    servers List<Property Map>
    The backend servers. See servers below.
    status String
    The status of the backend server.
    stickySessionConfig Property Map
    The configuration of session persistence. See sticky_session_config below.
    tags Map<Any>
    A mapping of tags to assign to the resource.
    vpcId String
    The ID of the VPC that you want to access. NOTE: This parameter takes effect when the server_group_type parameter is set to Instance or Ip.

    Supporting Types

    ServerGroupHealthCheckConfig, ServerGroupHealthCheckConfigArgs

    HealthCheckEnabled bool
    Specifies whether to enable the health check feature. Valid values: true, false.
    HealthCheckCodes List<string>
    The HTTP status codes that are used to indicate whether the backend server passes the health check. Valid values:

    • If health_check_protocol is set to HTTP or HTTPS. Valid values: http_2xx, http_3xx, http_4xx, and http_5xx. Default value: http_2xx.
    • If health_check_protocol is set to gRPC. Valid values: 0 to 99. Default value: 0.
    HealthCheckConnectPort int
    The backend port that is used for health checks. Default value: 0. Valid values: 0 to 65535. A value of 0 indicates that a backend server port is used for health checks.
    HealthCheckHost string
    The domain name that is used for health checks.
    HealthCheckHttpVersion string
    The version of the HTTP protocol. Default value: HTTP1.1. Valid values: HTTP1.0 and HTTP1.1. NOTE: This parameter takes effect only when health_check_protocol is set to HTTP or HTTPS.
    HealthCheckInterval int
    The interval at which health checks are performed. Unit: seconds. Default value: 2. Valid values: 1 to 50.
    HealthCheckMethod string
    The HTTP method that is used for health checks. Default value: GET. Valid values: GET, POST, HEAD. NOTE: This parameter takes effect only when health_check_protocol is set to HTTP, HTTPS, or gRPC. From version 1.215.0, health_check_method can be set to POST.
    HealthCheckPath string
    The path that is used for health checks. NOTE: This parameter takes effect only when health_check_protocol is set to HTTP or HTTPS.
    HealthCheckProtocol string
    The protocol that is used for health checks. Valid values: HTTP, HTTPS, TCP and gRPC.
    HealthCheckTimeout int
    The timeout period for a health check response. If a backend Elastic Compute Service (ECS) instance does not send an expected response within the specified period of time, the ECS instance is considered unhealthy. Unit: seconds. Default value: 5. Valid values: 1 to 300. NOTE: If the value of health_check_timeout is smaller than the value of health_check_interval, the value of health_check_timeout is ignored and the value of health_check_interval is used.
    HealthyThreshold int
    The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy. Default value: 3. Valid values: 2 to 10.
    UnhealthyThreshold int
    The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy. Default value: 3. Valid values: 2 to 10.
    HealthCheckEnabled bool
    Specifies whether to enable the health check feature. Valid values: true, false.
    HealthCheckCodes []string
    The HTTP status codes that are used to indicate whether the backend server passes the health check. Valid values:

    • If health_check_protocol is set to HTTP or HTTPS. Valid values: http_2xx, http_3xx, http_4xx, and http_5xx. Default value: http_2xx.
    • If health_check_protocol is set to gRPC. Valid values: 0 to 99. Default value: 0.
    HealthCheckConnectPort int
    The backend port that is used for health checks. Default value: 0. Valid values: 0 to 65535. A value of 0 indicates that a backend server port is used for health checks.
    HealthCheckHost string
    The domain name that is used for health checks.
    HealthCheckHttpVersion string
    The version of the HTTP protocol. Default value: HTTP1.1. Valid values: HTTP1.0 and HTTP1.1. NOTE: This parameter takes effect only when health_check_protocol is set to HTTP or HTTPS.
    HealthCheckInterval int
    The interval at which health checks are performed. Unit: seconds. Default value: 2. Valid values: 1 to 50.
    HealthCheckMethod string
    The HTTP method that is used for health checks. Default value: GET. Valid values: GET, POST, HEAD. NOTE: This parameter takes effect only when health_check_protocol is set to HTTP, HTTPS, or gRPC. From version 1.215.0, health_check_method can be set to POST.
    HealthCheckPath string
    The path that is used for health checks. NOTE: This parameter takes effect only when health_check_protocol is set to HTTP or HTTPS.
    HealthCheckProtocol string
    The protocol that is used for health checks. Valid values: HTTP, HTTPS, TCP and gRPC.
    HealthCheckTimeout int
    The timeout period for a health check response. If a backend Elastic Compute Service (ECS) instance does not send an expected response within the specified period of time, the ECS instance is considered unhealthy. Unit: seconds. Default value: 5. Valid values: 1 to 300. NOTE: If the value of health_check_timeout is smaller than the value of health_check_interval, the value of health_check_timeout is ignored and the value of health_check_interval is used.
    HealthyThreshold int
    The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy. Default value: 3. Valid values: 2 to 10.
    UnhealthyThreshold int
    The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy. Default value: 3. Valid values: 2 to 10.
    healthCheckEnabled Boolean
    Specifies whether to enable the health check feature. Valid values: true, false.
    healthCheckCodes List<String>
    The HTTP status codes that are used to indicate whether the backend server passes the health check. Valid values:

    • If health_check_protocol is set to HTTP or HTTPS. Valid values: http_2xx, http_3xx, http_4xx, and http_5xx. Default value: http_2xx.
    • If health_check_protocol is set to gRPC. Valid values: 0 to 99. Default value: 0.
    healthCheckConnectPort Integer
    The backend port that is used for health checks. Default value: 0. Valid values: 0 to 65535. A value of 0 indicates that a backend server port is used for health checks.
    healthCheckHost String
    The domain name that is used for health checks.
    healthCheckHttpVersion String
    The version of the HTTP protocol. Default value: HTTP1.1. Valid values: HTTP1.0 and HTTP1.1. NOTE: This parameter takes effect only when health_check_protocol is set to HTTP or HTTPS.
    healthCheckInterval Integer
    The interval at which health checks are performed. Unit: seconds. Default value: 2. Valid values: 1 to 50.
    healthCheckMethod String
    The HTTP method that is used for health checks. Default value: GET. Valid values: GET, POST, HEAD. NOTE: This parameter takes effect only when health_check_protocol is set to HTTP, HTTPS, or gRPC. From version 1.215.0, health_check_method can be set to POST.
    healthCheckPath String
    The path that is used for health checks. NOTE: This parameter takes effect only when health_check_protocol is set to HTTP or HTTPS.
    healthCheckProtocol String
    The protocol that is used for health checks. Valid values: HTTP, HTTPS, TCP and gRPC.
    healthCheckTimeout Integer
    The timeout period for a health check response. If a backend Elastic Compute Service (ECS) instance does not send an expected response within the specified period of time, the ECS instance is considered unhealthy. Unit: seconds. Default value: 5. Valid values: 1 to 300. NOTE: If the value of health_check_timeout is smaller than the value of health_check_interval, the value of health_check_timeout is ignored and the value of health_check_interval is used.
    healthyThreshold Integer
    The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy. Default value: 3. Valid values: 2 to 10.
    unhealthyThreshold Integer
    The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy. Default value: 3. Valid values: 2 to 10.
    healthCheckEnabled boolean
    Specifies whether to enable the health check feature. Valid values: true, false.
    healthCheckCodes string[]
    The HTTP status codes that are used to indicate whether the backend server passes the health check. Valid values:

    • If health_check_protocol is set to HTTP or HTTPS. Valid values: http_2xx, http_3xx, http_4xx, and http_5xx. Default value: http_2xx.
    • If health_check_protocol is set to gRPC. Valid values: 0 to 99. Default value: 0.
    healthCheckConnectPort number
    The backend port that is used for health checks. Default value: 0. Valid values: 0 to 65535. A value of 0 indicates that a backend server port is used for health checks.
    healthCheckHost string
    The domain name that is used for health checks.
    healthCheckHttpVersion string
    The version of the HTTP protocol. Default value: HTTP1.1. Valid values: HTTP1.0 and HTTP1.1. NOTE: This parameter takes effect only when health_check_protocol is set to HTTP or HTTPS.
    healthCheckInterval number
    The interval at which health checks are performed. Unit: seconds. Default value: 2. Valid values: 1 to 50.
    healthCheckMethod string
    The HTTP method that is used for health checks. Default value: GET. Valid values: GET, POST, HEAD. NOTE: This parameter takes effect only when health_check_protocol is set to HTTP, HTTPS, or gRPC. From version 1.215.0, health_check_method can be set to POST.
    healthCheckPath string
    The path that is used for health checks. NOTE: This parameter takes effect only when health_check_protocol is set to HTTP or HTTPS.
    healthCheckProtocol string
    The protocol that is used for health checks. Valid values: HTTP, HTTPS, TCP and gRPC.
    healthCheckTimeout number
    The timeout period for a health check response. If a backend Elastic Compute Service (ECS) instance does not send an expected response within the specified period of time, the ECS instance is considered unhealthy. Unit: seconds. Default value: 5. Valid values: 1 to 300. NOTE: If the value of health_check_timeout is smaller than the value of health_check_interval, the value of health_check_timeout is ignored and the value of health_check_interval is used.
    healthyThreshold number
    The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy. Default value: 3. Valid values: 2 to 10.
    unhealthyThreshold number
    The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy. Default value: 3. Valid values: 2 to 10.
    health_check_enabled bool
    Specifies whether to enable the health check feature. Valid values: true, false.
    health_check_codes Sequence[str]
    The HTTP status codes that are used to indicate whether the backend server passes the health check. Valid values:

    • If health_check_protocol is set to HTTP or HTTPS. Valid values: http_2xx, http_3xx, http_4xx, and http_5xx. Default value: http_2xx.
    • If health_check_protocol is set to gRPC. Valid values: 0 to 99. Default value: 0.
    health_check_connect_port int
    The backend port that is used for health checks. Default value: 0. Valid values: 0 to 65535. A value of 0 indicates that a backend server port is used for health checks.
    health_check_host str
    The domain name that is used for health checks.
    health_check_http_version str
    The version of the HTTP protocol. Default value: HTTP1.1. Valid values: HTTP1.0 and HTTP1.1. NOTE: This parameter takes effect only when health_check_protocol is set to HTTP or HTTPS.
    health_check_interval int
    The interval at which health checks are performed. Unit: seconds. Default value: 2. Valid values: 1 to 50.
    health_check_method str
    The HTTP method that is used for health checks. Default value: GET. Valid values: GET, POST, HEAD. NOTE: This parameter takes effect only when health_check_protocol is set to HTTP, HTTPS, or gRPC. From version 1.215.0, health_check_method can be set to POST.
    health_check_path str
    The path that is used for health checks. NOTE: This parameter takes effect only when health_check_protocol is set to HTTP or HTTPS.
    health_check_protocol str
    The protocol that is used for health checks. Valid values: HTTP, HTTPS, TCP and gRPC.
    health_check_timeout int
    The timeout period for a health check response. If a backend Elastic Compute Service (ECS) instance does not send an expected response within the specified period of time, the ECS instance is considered unhealthy. Unit: seconds. Default value: 5. Valid values: 1 to 300. NOTE: If the value of health_check_timeout is smaller than the value of health_check_interval, the value of health_check_timeout is ignored and the value of health_check_interval is used.
    healthy_threshold int
    The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy. Default value: 3. Valid values: 2 to 10.
    unhealthy_threshold int
    The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy. Default value: 3. Valid values: 2 to 10.
    healthCheckEnabled Boolean
    Specifies whether to enable the health check feature. Valid values: true, false.
    healthCheckCodes List<String>
    The HTTP status codes that are used to indicate whether the backend server passes the health check. Valid values:

    • If health_check_protocol is set to HTTP or HTTPS. Valid values: http_2xx, http_3xx, http_4xx, and http_5xx. Default value: http_2xx.
    • If health_check_protocol is set to gRPC. Valid values: 0 to 99. Default value: 0.
    healthCheckConnectPort Number
    The backend port that is used for health checks. Default value: 0. Valid values: 0 to 65535. A value of 0 indicates that a backend server port is used for health checks.
    healthCheckHost String
    The domain name that is used for health checks.
    healthCheckHttpVersion String
    The version of the HTTP protocol. Default value: HTTP1.1. Valid values: HTTP1.0 and HTTP1.1. NOTE: This parameter takes effect only when health_check_protocol is set to HTTP or HTTPS.
    healthCheckInterval Number
    The interval at which health checks are performed. Unit: seconds. Default value: 2. Valid values: 1 to 50.
    healthCheckMethod String
    The HTTP method that is used for health checks. Default value: GET. Valid values: GET, POST, HEAD. NOTE: This parameter takes effect only when health_check_protocol is set to HTTP, HTTPS, or gRPC. From version 1.215.0, health_check_method can be set to POST.
    healthCheckPath String
    The path that is used for health checks. NOTE: This parameter takes effect only when health_check_protocol is set to HTTP or HTTPS.
    healthCheckProtocol String
    The protocol that is used for health checks. Valid values: HTTP, HTTPS, TCP and gRPC.
    healthCheckTimeout Number
    The timeout period for a health check response. If a backend Elastic Compute Service (ECS) instance does not send an expected response within the specified period of time, the ECS instance is considered unhealthy. Unit: seconds. Default value: 5. Valid values: 1 to 300. NOTE: If the value of health_check_timeout is smaller than the value of health_check_interval, the value of health_check_timeout is ignored and the value of health_check_interval is used.
    healthyThreshold Number
    The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy. Default value: 3. Valid values: 2 to 10.
    unhealthyThreshold Number
    The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy. Default value: 3. Valid values: 2 to 10.

    ServerGroupServer, ServerGroupServerArgs

    ServerId string
    The ID of the backend server.

    • If server_group_type is set to Instance, set the parameter to the ID of an Elastic Compute Service (ECS) instance, an elastic network interface (ENI), or an elastic container instance. These backend servers are specified by Ecs, Eni, or Eci.
    • If server_group_type is set to Ip, set the parameter to an IP address specified in the server group.
    • If server_group_type is set to Fc, set the parameter to the Alibaba Cloud Resource Name (ARN) of a function specified in the server group.
    ServerType string
    The type of the server. The type of the server. Valid values:
    Description string
    The description of the backend server.
    Port int
    The port used by the backend server. Valid values: 1 to 65535. Note: This parameter is required if the server_type parameter is set to Ecs, Eni, Eci, or Ip. You do not need to configure this parameter if you set server_type to Fc.
    RemoteIpEnabled bool
    Specifies whether to enable the remote IP address feature. You can specify up to 40 servers in each call. Note: If server_type is set to Ip, this parameter is available.
    ServerIp string
    The IP address of an Elastic Compute Service (ECS) instance, an elastic network interface (ENI), or an elastic container instance. Note: If server_group_type is set to Fc, you do not need to configure parameters, otherwise this attribute is required. If server_group_type is set to Ip, the value of this property is the same as the server_id value.
    Status string
    The status of the backend server.
    Weight int
    The weight of the server. Default value: 100. Valid values: 0 to 100. If the value is set to 0, no requests are forwarded to the server. Note: You do not need to set this parameter if you set server_type to Fc.
    ServerId string
    The ID of the backend server.

    • If server_group_type is set to Instance, set the parameter to the ID of an Elastic Compute Service (ECS) instance, an elastic network interface (ENI), or an elastic container instance. These backend servers are specified by Ecs, Eni, or Eci.
    • If server_group_type is set to Ip, set the parameter to an IP address specified in the server group.
    • If server_group_type is set to Fc, set the parameter to the Alibaba Cloud Resource Name (ARN) of a function specified in the server group.
    ServerType string
    The type of the server. The type of the server. Valid values:
    Description string
    The description of the backend server.
    Port int
    The port used by the backend server. Valid values: 1 to 65535. Note: This parameter is required if the server_type parameter is set to Ecs, Eni, Eci, or Ip. You do not need to configure this parameter if you set server_type to Fc.
    RemoteIpEnabled bool
    Specifies whether to enable the remote IP address feature. You can specify up to 40 servers in each call. Note: If server_type is set to Ip, this parameter is available.
    ServerIp string
    The IP address of an Elastic Compute Service (ECS) instance, an elastic network interface (ENI), or an elastic container instance. Note: If server_group_type is set to Fc, you do not need to configure parameters, otherwise this attribute is required. If server_group_type is set to Ip, the value of this property is the same as the server_id value.
    Status string
    The status of the backend server.
    Weight int
    The weight of the server. Default value: 100. Valid values: 0 to 100. If the value is set to 0, no requests are forwarded to the server. Note: You do not need to set this parameter if you set server_type to Fc.
    serverId String
    The ID of the backend server.

    • If server_group_type is set to Instance, set the parameter to the ID of an Elastic Compute Service (ECS) instance, an elastic network interface (ENI), or an elastic container instance. These backend servers are specified by Ecs, Eni, or Eci.
    • If server_group_type is set to Ip, set the parameter to an IP address specified in the server group.
    • If server_group_type is set to Fc, set the parameter to the Alibaba Cloud Resource Name (ARN) of a function specified in the server group.
    serverType String
    The type of the server. The type of the server. Valid values:
    description String
    The description of the backend server.
    port Integer
    The port used by the backend server. Valid values: 1 to 65535. Note: This parameter is required if the server_type parameter is set to Ecs, Eni, Eci, or Ip. You do not need to configure this parameter if you set server_type to Fc.
    remoteIpEnabled Boolean
    Specifies whether to enable the remote IP address feature. You can specify up to 40 servers in each call. Note: If server_type is set to Ip, this parameter is available.
    serverIp String
    The IP address of an Elastic Compute Service (ECS) instance, an elastic network interface (ENI), or an elastic container instance. Note: If server_group_type is set to Fc, you do not need to configure parameters, otherwise this attribute is required. If server_group_type is set to Ip, the value of this property is the same as the server_id value.
    status String
    The status of the backend server.
    weight Integer
    The weight of the server. Default value: 100. Valid values: 0 to 100. If the value is set to 0, no requests are forwarded to the server. Note: You do not need to set this parameter if you set server_type to Fc.
    serverId string
    The ID of the backend server.

    • If server_group_type is set to Instance, set the parameter to the ID of an Elastic Compute Service (ECS) instance, an elastic network interface (ENI), or an elastic container instance. These backend servers are specified by Ecs, Eni, or Eci.
    • If server_group_type is set to Ip, set the parameter to an IP address specified in the server group.
    • If server_group_type is set to Fc, set the parameter to the Alibaba Cloud Resource Name (ARN) of a function specified in the server group.
    serverType string
    The type of the server. The type of the server. Valid values:
    description string
    The description of the backend server.
    port number
    The port used by the backend server. Valid values: 1 to 65535. Note: This parameter is required if the server_type parameter is set to Ecs, Eni, Eci, or Ip. You do not need to configure this parameter if you set server_type to Fc.
    remoteIpEnabled boolean
    Specifies whether to enable the remote IP address feature. You can specify up to 40 servers in each call. Note: If server_type is set to Ip, this parameter is available.
    serverIp string
    The IP address of an Elastic Compute Service (ECS) instance, an elastic network interface (ENI), or an elastic container instance. Note: If server_group_type is set to Fc, you do not need to configure parameters, otherwise this attribute is required. If server_group_type is set to Ip, the value of this property is the same as the server_id value.
    status string
    The status of the backend server.
    weight number
    The weight of the server. Default value: 100. Valid values: 0 to 100. If the value is set to 0, no requests are forwarded to the server. Note: You do not need to set this parameter if you set server_type to Fc.
    server_id str
    The ID of the backend server.

    • If server_group_type is set to Instance, set the parameter to the ID of an Elastic Compute Service (ECS) instance, an elastic network interface (ENI), or an elastic container instance. These backend servers are specified by Ecs, Eni, or Eci.
    • If server_group_type is set to Ip, set the parameter to an IP address specified in the server group.
    • If server_group_type is set to Fc, set the parameter to the Alibaba Cloud Resource Name (ARN) of a function specified in the server group.
    server_type str
    The type of the server. The type of the server. Valid values:
    description str
    The description of the backend server.
    port int
    The port used by the backend server. Valid values: 1 to 65535. Note: This parameter is required if the server_type parameter is set to Ecs, Eni, Eci, or Ip. You do not need to configure this parameter if you set server_type to Fc.
    remote_ip_enabled bool
    Specifies whether to enable the remote IP address feature. You can specify up to 40 servers in each call. Note: If server_type is set to Ip, this parameter is available.
    server_ip str
    The IP address of an Elastic Compute Service (ECS) instance, an elastic network interface (ENI), or an elastic container instance. Note: If server_group_type is set to Fc, you do not need to configure parameters, otherwise this attribute is required. If server_group_type is set to Ip, the value of this property is the same as the server_id value.
    status str
    The status of the backend server.
    weight int
    The weight of the server. Default value: 100. Valid values: 0 to 100. If the value is set to 0, no requests are forwarded to the server. Note: You do not need to set this parameter if you set server_type to Fc.
    serverId String
    The ID of the backend server.

    • If server_group_type is set to Instance, set the parameter to the ID of an Elastic Compute Service (ECS) instance, an elastic network interface (ENI), or an elastic container instance. These backend servers are specified by Ecs, Eni, or Eci.
    • If server_group_type is set to Ip, set the parameter to an IP address specified in the server group.
    • If server_group_type is set to Fc, set the parameter to the Alibaba Cloud Resource Name (ARN) of a function specified in the server group.
    serverType String
    The type of the server. The type of the server. Valid values:
    description String
    The description of the backend server.
    port Number
    The port used by the backend server. Valid values: 1 to 65535. Note: This parameter is required if the server_type parameter is set to Ecs, Eni, Eci, or Ip. You do not need to configure this parameter if you set server_type to Fc.
    remoteIpEnabled Boolean
    Specifies whether to enable the remote IP address feature. You can specify up to 40 servers in each call. Note: If server_type is set to Ip, this parameter is available.
    serverIp String
    The IP address of an Elastic Compute Service (ECS) instance, an elastic network interface (ENI), or an elastic container instance. Note: If server_group_type is set to Fc, you do not need to configure parameters, otherwise this attribute is required. If server_group_type is set to Ip, the value of this property is the same as the server_id value.
    status String
    The status of the backend server.
    weight Number
    The weight of the server. Default value: 100. Valid values: 0 to 100. If the value is set to 0, no requests are forwarded to the server. Note: You do not need to set this parameter if you set server_type to Fc.

    ServerGroupStickySessionConfig, ServerGroupStickySessionConfigArgs

    Cookie string
    The cookie to be configured on the server. NOTE: This parameter takes effect when the sticky_session_enabled parameter is set to true and the sticky_session_type parameter is set to Server.
    CookieTimeout int
    The timeout period of a cookie. Unit: seconds. Default value: 1000. Valid values: 1 to 86400. NOTE: This parameter takes effect when the sticky_session_enabled parameter is set to true and the sticky_session_type parameter is set to Insert.
    StickySessionEnabled bool
    Specifies whether to enable session persistence. Default value: false. Valid values: true, false. NOTE: This parameter takes effect when the server_group_type parameter is set to Instance or Ip.
    StickySessionType string
    The method that is used to handle a cookie. Valid values: Server, Insert.
    Cookie string
    The cookie to be configured on the server. NOTE: This parameter takes effect when the sticky_session_enabled parameter is set to true and the sticky_session_type parameter is set to Server.
    CookieTimeout int
    The timeout period of a cookie. Unit: seconds. Default value: 1000. Valid values: 1 to 86400. NOTE: This parameter takes effect when the sticky_session_enabled parameter is set to true and the sticky_session_type parameter is set to Insert.
    StickySessionEnabled bool
    Specifies whether to enable session persistence. Default value: false. Valid values: true, false. NOTE: This parameter takes effect when the server_group_type parameter is set to Instance or Ip.
    StickySessionType string
    The method that is used to handle a cookie. Valid values: Server, Insert.
    cookie String
    The cookie to be configured on the server. NOTE: This parameter takes effect when the sticky_session_enabled parameter is set to true and the sticky_session_type parameter is set to Server.
    cookieTimeout Integer
    The timeout period of a cookie. Unit: seconds. Default value: 1000. Valid values: 1 to 86400. NOTE: This parameter takes effect when the sticky_session_enabled parameter is set to true and the sticky_session_type parameter is set to Insert.
    stickySessionEnabled Boolean
    Specifies whether to enable session persistence. Default value: false. Valid values: true, false. NOTE: This parameter takes effect when the server_group_type parameter is set to Instance or Ip.
    stickySessionType String
    The method that is used to handle a cookie. Valid values: Server, Insert.
    cookie string
    The cookie to be configured on the server. NOTE: This parameter takes effect when the sticky_session_enabled parameter is set to true and the sticky_session_type parameter is set to Server.
    cookieTimeout number
    The timeout period of a cookie. Unit: seconds. Default value: 1000. Valid values: 1 to 86400. NOTE: This parameter takes effect when the sticky_session_enabled parameter is set to true and the sticky_session_type parameter is set to Insert.
    stickySessionEnabled boolean
    Specifies whether to enable session persistence. Default value: false. Valid values: true, false. NOTE: This parameter takes effect when the server_group_type parameter is set to Instance or Ip.
    stickySessionType string
    The method that is used to handle a cookie. Valid values: Server, Insert.
    cookie str
    The cookie to be configured on the server. NOTE: This parameter takes effect when the sticky_session_enabled parameter is set to true and the sticky_session_type parameter is set to Server.
    cookie_timeout int
    The timeout period of a cookie. Unit: seconds. Default value: 1000. Valid values: 1 to 86400. NOTE: This parameter takes effect when the sticky_session_enabled parameter is set to true and the sticky_session_type parameter is set to Insert.
    sticky_session_enabled bool
    Specifies whether to enable session persistence. Default value: false. Valid values: true, false. NOTE: This parameter takes effect when the server_group_type parameter is set to Instance or Ip.
    sticky_session_type str
    The method that is used to handle a cookie. Valid values: Server, Insert.
    cookie String
    The cookie to be configured on the server. NOTE: This parameter takes effect when the sticky_session_enabled parameter is set to true and the sticky_session_type parameter is set to Server.
    cookieTimeout Number
    The timeout period of a cookie. Unit: seconds. Default value: 1000. Valid values: 1 to 86400. NOTE: This parameter takes effect when the sticky_session_enabled parameter is set to true and the sticky_session_type parameter is set to Insert.
    stickySessionEnabled Boolean
    Specifies whether to enable session persistence. Default value: false. Valid values: true, false. NOTE: This parameter takes effect when the server_group_type parameter is set to Instance or Ip.
    stickySessionType String
    The method that is used to handle a cookie. Valid values: Server, Insert.

    Import

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

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

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi