Alibaba Cloud

v3.15.0 published on Thursday, Jan 13, 2022 by Pulumi

ServerGroup

Provides a ALB Server Group resource.

For information about ALB Server Group and how to use it, see What is Server Group.

NOTE: Available in v1.131.0+.

Example Usage

using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var config = new Config();
        var name = config.Get("name") ?? "example_value";
        var defaultZones = Output.Create(AliCloud.GetZones.InvokeAsync(new AliCloud.GetZonesArgs
        {
            AvailableDiskCategory = "cloud_efficiency",
            AvailableResourceCreation = "VSwitch",
        }));
        var defaultInstanceTypes = defaultZones.Apply(defaultZones => Output.Create(AliCloud.Ecs.GetInstanceTypes.InvokeAsync(new AliCloud.Ecs.GetInstanceTypesArgs
        {
            AvailabilityZone = defaultZones.Zones?[0]?.Id,
            CpuCoreCount = 1,
            MemorySize = 2,
        })));
        var defaultImages = Output.Create(AliCloud.Ecs.GetImages.InvokeAsync(new AliCloud.Ecs.GetImagesArgs
        {
            NameRegex = "^ubuntu_18.*64",
            MostRecent = true,
            Owners = "system",
        }));
        var defaultNetwork = new AliCloud.Vpc.Network("defaultNetwork", new AliCloud.Vpc.NetworkArgs
        {
            VpcName = name,
            CidrBlock = "172.16.0.0/16",
        });
        var defaultSwitch = new AliCloud.Vpc.Switch("defaultSwitch", new AliCloud.Vpc.SwitchArgs
        {
            VpcId = defaultNetwork.Id,
            CidrBlock = "172.16.0.0/16",
            ZoneId = defaultZones.Apply(defaultZones => defaultZones.Zones?[0]?.Id),
            VswitchName = name,
        });
        var defaultSecurityGroup = new AliCloud.Ecs.SecurityGroup("defaultSecurityGroup", new AliCloud.Ecs.SecurityGroupArgs
        {
            VpcId = defaultNetwork.Id,
        });
        var defaultInstance = new AliCloud.Ecs.Instance("defaultInstance", new AliCloud.Ecs.InstanceArgs
        {
            ImageId = defaultImages.Apply(defaultImages => defaultImages.Images?[0]?.Id),
            InstanceType = defaultInstanceTypes.Apply(defaultInstanceTypes => defaultInstanceTypes.InstanceTypes?[0]?.Id),
            InstanceName = name,
            SecurityGroups = 
            {
                defaultSecurityGroup,
            }.Select(__item => __item.Id).ToList(),
            InternetChargeType = "PayByTraffic",
            InternetMaxBandwidthOut = 10,
            AvailabilityZone = defaultZones.Apply(defaultZones => defaultZones.Zones?[0]?.Id),
            InstanceChargeType = "PostPaid",
            SystemDiskCategory = "cloud_efficiency",
            VswitchId = defaultSwitch.Id,
        });
        var defaultResourceGroups = Output.Create(AliCloud.ResourceManager.GetResourceGroups.InvokeAsync());
        var defaultServerGroup = new AliCloud.Alb.ServerGroup("defaultServerGroup", new AliCloud.Alb.ServerGroupArgs
        {
            Protocol = "HTTP",
            VpcId = defaultNetwork.Id,
            ServerGroupName = name,
            ResourceGroupId = defaultResourceGroups.Apply(defaultResourceGroups => defaultResourceGroups.Groups?[0]?.Id),
            HealthCheckConfig = new AliCloud.Alb.Inputs.ServerGroupHealthCheckConfigArgs
            {
                HealthCheckConnectPort = 46325,
                HealthCheckEnabled = true,
                HealthCheckHost = "tf-testAcc.com",
                HealthCheckCodes = 
                {
                    "http_2xx",
                    "http_3xx",
                    "http_4xx",
                },
                HealthCheckHttpVersion = "HTTP1.1",
                HealthCheckInterval = 2,
                HealthCheckMethod = "HEAD",
                HealthCheckPath = "/tf-testAcc",
                HealthCheckProtocol = "HTTP",
                HealthCheckTimeout = 5,
                HealthyThreshold = 3,
                UnhealthyThreshold = 3,
            },
            StickySessionConfig = new AliCloud.Alb.Inputs.ServerGroupStickySessionConfigArgs
            {
                StickySessionEnabled = true,
                Cookie = "tf-testAcc",
                StickySessionType = "Server",
            },
            Tags = 
            {
                { "Created", "TF" },
            },
            Servers = 
            {
                new AliCloud.Alb.Inputs.ServerGroupServerArgs
                {
                    Description = name,
                    Port = 80,
                    ServerId = defaultInstance.Id,
                    ServerIp = defaultInstance.PrivateIp,
                    ServerType = "Ecs",
                    Weight = 10,
                },
            },
        });
    }

}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "example_value"
default_zones = alicloud.get_zones(available_disk_category="cloud_efficiency",
    available_resource_creation="VSwitch")
default_instance_types = alicloud.ecs.get_instance_types(availability_zone=default_zones.zones[0].id,
    cpu_core_count=1,
    memory_size=2)
default_images = alicloud.ecs.get_images(name_regex="^ubuntu_18.*64",
    most_recent=True,
    owners="system")
default_network = alicloud.vpc.Network("defaultNetwork",
    vpc_name=name,
    cidr_block="172.16.0.0/16")
default_switch = alicloud.vpc.Switch("defaultSwitch",
    vpc_id=default_network.id,
    cidr_block="172.16.0.0/16",
    zone_id=default_zones.zones[0].id,
    vswitch_name=name)
default_security_group = alicloud.ecs.SecurityGroup("defaultSecurityGroup", vpc_id=default_network.id)
default_instance = alicloud.ecs.Instance("defaultInstance",
    image_id=default_images.images[0].id,
    instance_type=default_instance_types.instance_types[0].id,
    instance_name=name,
    security_groups=[__item.id for __item in [default_security_group]],
    internet_charge_type="PayByTraffic",
    internet_max_bandwidth_out=10,
    availability_zone=default_zones.zones[0].id,
    instance_charge_type="PostPaid",
    system_disk_category="cloud_efficiency",
    vswitch_id=default_switch.id)
default_resource_groups = alicloud.resourcemanager.get_resource_groups()
default_server_group = alicloud.alb.ServerGroup("defaultServerGroup",
    protocol="HTTP",
    vpc_id=default_network.id,
    server_group_name=name,
    resource_group_id=default_resource_groups.groups[0].id,
    health_check_config=alicloud.alb.ServerGroupHealthCheckConfigArgs(
        health_check_connect_port=46325,
        health_check_enabled=True,
        health_check_host="tf-testAcc.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-testAcc",
        health_check_protocol="HTTP",
        health_check_timeout=5,
        healthy_threshold=3,
        unhealthy_threshold=3,
    ),
    sticky_session_config=alicloud.alb.ServerGroupStickySessionConfigArgs(
        sticky_session_enabled=True,
        cookie="tf-testAcc",
        sticky_session_type="Server",
    ),
    tags={
        "Created": "TF",
    },
    servers=[alicloud.alb.ServerGroupServerArgs(
        description=name,
        port=80,
        server_id=default_instance.id,
        server_ip=default_instance.private_ip,
        server_type="Ecs",
        weight=10,
    )])
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const config = new pulumi.Config();
const name = config.get("name") || "example_value";
const defaultZones = alicloud.getZones({
    availableDiskCategory: "cloud_efficiency",
    availableResourceCreation: "VSwitch",
});
const defaultInstanceTypes = defaultZones.then(defaultZones => alicloud.ecs.getInstanceTypes({
    availabilityZone: defaultZones.zones?[0]?.id,
    cpuCoreCount: 1,
    memorySize: 2,
}));
const defaultImages = alicloud.ecs.getImages({
    nameRegex: "^ubuntu_18.*64",
    mostRecent: true,
    owners: "system",
});
const defaultNetwork = new alicloud.vpc.Network("defaultNetwork", {
    vpcName: name,
    cidrBlock: "172.16.0.0/16",
});
const defaultSwitch = new alicloud.vpc.Switch("defaultSwitch", {
    vpcId: defaultNetwork.id,
    cidrBlock: "172.16.0.0/16",
    zoneId: defaultZones.then(defaultZones => defaultZones.zones?[0]?.id),
    vswitchName: name,
});
const defaultSecurityGroup = new alicloud.ecs.SecurityGroup("defaultSecurityGroup", {vpcId: defaultNetwork.id});
const defaultInstance = new alicloud.ecs.Instance("defaultInstance", {
    imageId: defaultImages.then(defaultImages => defaultImages.images?[0]?.id),
    instanceType: defaultInstanceTypes.then(defaultInstanceTypes => defaultInstanceTypes.instanceTypes?[0]?.id),
    instanceName: name,
    securityGroups: [defaultSecurityGroup].map(__item => __item.id),
    internetChargeType: "PayByTraffic",
    internetMaxBandwidthOut: "10",
    availabilityZone: defaultZones.then(defaultZones => defaultZones.zones?[0]?.id),
    instanceChargeType: "PostPaid",
    systemDiskCategory: "cloud_efficiency",
    vswitchId: defaultSwitch.id,
});
const defaultResourceGroups = alicloud.resourcemanager.getResourceGroups({});
const defaultServerGroup = new alicloud.alb.ServerGroup("defaultServerGroup", {
    protocol: "HTTP",
    vpcId: defaultNetwork.id,
    serverGroupName: name,
    resourceGroupId: defaultResourceGroups.then(defaultResourceGroups => defaultResourceGroups.groups?[0]?.id),
    healthCheckConfig: {
        healthCheckConnectPort: "46325",
        healthCheckEnabled: true,
        healthCheckHost: "tf-testAcc.com",
        healthCheckCodes: [
            "http_2xx",
            "http_3xx",
            "http_4xx",
        ],
        healthCheckHttpVersion: "HTTP1.1",
        healthCheckInterval: "2",
        healthCheckMethod: "HEAD",
        healthCheckPath: "/tf-testAcc",
        healthCheckProtocol: "HTTP",
        healthCheckTimeout: 5,
        healthyThreshold: 3,
        unhealthyThreshold: 3,
    },
    stickySessionConfig: {
        stickySessionEnabled: true,
        cookie: "tf-testAcc",
        stickySessionType: "Server",
    },
    tags: {
        Created: "TF",
    },
    servers: [{
        description: name,
        port: 80,
        serverId: defaultInstance.id,
        serverIp: defaultInstance.privateIp,
        serverType: "Ecs",
        weight: 10,
    }],
});

Create a 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,
                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: Optional[ServerGroupArgs] = None,
                opts: Optional[ResourceOptions] = None)
func NewServerGroup(ctx *Context, name string, args *ServerGroupArgs, opts ...ResourceOption) (*ServerGroup, error)
public ServerGroup(string name, ServerGroupArgs? args = null, CustomResourceOptions? opts = null)
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.

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:

DryRun bool
The dry run.
HealthCheckConfig Pulumi.AliCloud.Alb.Inputs.ServerGroupHealthCheckConfigArgs
The configuration of health checks.
Protocol string
The server protocol. Valid values: HTTPS, HTTP.
ResourceGroupId string
The ID of the resource group.
Scheduler string
The scheduling algorithm. Valid values: Sch, Wlc, Wrr.
ServerGroupName string
The name of the resource.
Servers List<Pulumi.AliCloud.Alb.Inputs.ServerGroupServerArgs>
The backend server.
StickySessionConfig Pulumi.AliCloud.Alb.Inputs.ServerGroupStickySessionConfigArgs
The configuration of the sticky session.
Tags Dictionary<string, object>
VpcId string
The ID of the VPC that you want to access.
DryRun bool
The dry run.
HealthCheckConfig ServerGroupHealthCheckConfigArgs
The configuration of health checks.
Protocol string
The server protocol. Valid values: HTTPS, HTTP.
ResourceGroupId string
The ID of the resource group.
Scheduler string
The scheduling algorithm. Valid values: Sch, Wlc, Wrr.
ServerGroupName string
The name of the resource.
Servers []ServerGroupServerArgs
The backend server.
StickySessionConfig ServerGroupStickySessionConfigArgs
The configuration of the sticky session.
Tags map[string]interface{}
VpcId string
The ID of the VPC that you want to access.
dryRun boolean
The dry run.
healthCheckConfig ServerGroupHealthCheckConfigArgs
The configuration of health checks.
protocol string
The server protocol. Valid values: HTTPS, HTTP.
resourceGroupId string
The ID of the resource group.
scheduler string
The scheduling algorithm. Valid values: Sch, Wlc, Wrr.
serverGroupName string
The name of the resource.
servers ServerGroupServerArgs[]
The backend server.
stickySessionConfig ServerGroupStickySessionConfigArgs
The configuration of the sticky session.
tags {[key: string]: any}
vpcId string
The ID of the VPC that you want to access.
dry_run bool
The dry run.
health_check_config ServerGroupHealthCheckConfigArgs
The configuration of health checks.
protocol str
The server protocol. Valid values: HTTPS, HTTP.
resource_group_id str
The ID of the resource group.
scheduler str
The scheduling algorithm. Valid values: Sch, Wlc, Wrr.
server_group_name str
The name of the resource.
servers Sequence[ServerGroupServerArgs]
The backend server.
sticky_session_config ServerGroupStickySessionConfigArgs
The configuration of the sticky session.
tags Mapping[str, Any]
vpc_id str
The ID of the VPC that you want to access.

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 resource.
Id string
The provider-assigned unique ID for this managed resource.
Status string
The status of the resource.
id string
The provider-assigned unique ID for this managed resource.
status string
The status of the resource.
id str
The provider-assigned unique ID for this managed resource.
status str
The status of the resource.

Look up an 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,
        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)
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.

The following state arguments are supported:

DryRun bool
The dry run.
HealthCheckConfig Pulumi.AliCloud.Alb.Inputs.ServerGroupHealthCheckConfigArgs
The configuration of health checks.
Protocol string
The server protocol. Valid values: HTTPS, HTTP.
ResourceGroupId string
The ID of the resource group.
Scheduler string
The scheduling algorithm. Valid values: Sch, Wlc, Wrr.
ServerGroupName string
The name of the resource.
Servers List<Pulumi.AliCloud.Alb.Inputs.ServerGroupServerArgs>
The backend server.
Status string
The status of the resource.
StickySessionConfig Pulumi.AliCloud.Alb.Inputs.ServerGroupStickySessionConfigArgs
The configuration of the sticky session.
Tags Dictionary<string, object>
VpcId string
The ID of the VPC that you want to access.
DryRun bool
The dry run.
HealthCheckConfig ServerGroupHealthCheckConfigArgs
The configuration of health checks.
Protocol string
The server protocol. Valid values: HTTPS, HTTP.
ResourceGroupId string
The ID of the resource group.
Scheduler string
The scheduling algorithm. Valid values: Sch, Wlc, Wrr.
ServerGroupName string
The name of the resource.
Servers []ServerGroupServerArgs
The backend server.
Status string
The status of the resource.
StickySessionConfig ServerGroupStickySessionConfigArgs
The configuration of the sticky session.
Tags map[string]interface{}
VpcId string
The ID of the VPC that you want to access.
dryRun boolean
The dry run.
healthCheckConfig ServerGroupHealthCheckConfigArgs
The configuration of health checks.
protocol string
The server protocol. Valid values: HTTPS, HTTP.
resourceGroupId string
The ID of the resource group.
scheduler string
The scheduling algorithm. Valid values: Sch, Wlc, Wrr.
serverGroupName string
The name of the resource.
servers ServerGroupServerArgs[]
The backend server.
status string
The status of the resource.
stickySessionConfig ServerGroupStickySessionConfigArgs
The configuration of the sticky session.
tags {[key: string]: any}
vpcId string
The ID of the VPC that you want to access.
dry_run bool
The dry run.
health_check_config ServerGroupHealthCheckConfigArgs
The configuration of health checks.
protocol str
The server protocol. Valid values: HTTPS, HTTP.
resource_group_id str
The ID of the resource group.
scheduler str
The scheduling algorithm. Valid values: Sch, Wlc, Wrr.
server_group_name str
The name of the resource.
servers Sequence[ServerGroupServerArgs]
The backend server.
status str
The status of the resource.
sticky_session_config ServerGroupStickySessionConfigArgs
The configuration of the sticky session.
tags Mapping[str, Any]
vpc_id str
The ID of the VPC that you want to access.

Supporting Types

ServerGroupHealthCheckConfig

HealthCheckCodes List<string>
The status code for a successful health check. Multiple status codes can be specified as a list. Valid values: http_2xx, http_3xx, http_4xx, and http_5xx. Default value: http_2xx. NOTE: This parameter exists if the HealthCheckProtocol parameter is set to HTTP.
HealthCheckConnectPort int
The port of the backend server that is used for health checks. Valid values: 0 to 65535. Default value: 0. A value of 0 indicates that a backend server port is used for health checks.
HealthCheckEnabled bool
Indicates whether health checks are enabled. Valid values: true, false. Default value: true.
HealthCheckHost string
The domain name that is used for health checks.
HealthCheckHttpVersion string
HTTP protocol version. Valid values: HTTP1.0 and HTTP1.1. Default value: HTTP1.1 . NOTE: This parameter exists if the HealthCheckProtocol parameter is set to HTTP.
HealthCheckInterval int
The time interval between two consecutive health checks. Unit: seconds. Valid values: 1 to 50. Default value: 2.
HealthCheckMethod string
Health check method. Valid values: GET and HEAD. Default: GET. NOTE: This parameter exists if the HealthCheckProtocol parameter is set to HTTP.
HealthCheckPath string
The forwarding rule path of health checks. NOTE: This parameter exists if the HealthCheckProtocol parameter is set to HTTP.
HealthCheckProtocol string
Health check protocol. Valid values: HTTP and TCP.
HealthCheckTimeout int
The timeout period of 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. Valid values: 1 to 300. Default value: 5. NOTE: If the value of the HealthCHeckTimeout parameter is smaller than that of the HealthCheckInterval parameter, the value of the HealthCHeckTimeout parameter is ignored and the value of the HealthCheckInterval parameter is regarded as the timeout period.
HealthyThreshold int
The number of health checks that an unhealthy backend server must pass consecutively before it is declared healthy. In this case, the health check state is changed from fail to success. Valid values: 2 to 10. Default value: 3.
UnhealthyThreshold int
The number of consecutive health checks that a healthy backend server must consecutively fail before it is declared unhealthy. In this case, the health check state is changed from success to fail. Valid values: 2 to 10. Default value: 3.
HealthCheckCodes []string
The status code for a successful health check. Multiple status codes can be specified as a list. Valid values: http_2xx, http_3xx, http_4xx, and http_5xx. Default value: http_2xx. NOTE: This parameter exists if the HealthCheckProtocol parameter is set to HTTP.
HealthCheckConnectPort int
The port of the backend server that is used for health checks. Valid values: 0 to 65535. Default value: 0. A value of 0 indicates that a backend server port is used for health checks.
HealthCheckEnabled bool
Indicates whether health checks are enabled. Valid values: true, false. Default value: true.
HealthCheckHost string
The domain name that is used for health checks.
HealthCheckHttpVersion string
HTTP protocol version. Valid values: HTTP1.0 and HTTP1.1. Default value: HTTP1.1 . NOTE: This parameter exists if the HealthCheckProtocol parameter is set to HTTP.
HealthCheckInterval int
The time interval between two consecutive health checks. Unit: seconds. Valid values: 1 to 50. Default value: 2.
HealthCheckMethod string
Health check method. Valid values: GET and HEAD. Default: GET. NOTE: This parameter exists if the HealthCheckProtocol parameter is set to HTTP.
HealthCheckPath string
The forwarding rule path of health checks. NOTE: This parameter exists if the HealthCheckProtocol parameter is set to HTTP.
HealthCheckProtocol string
Health check protocol. Valid values: HTTP and TCP.
HealthCheckTimeout int
The timeout period of 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. Valid values: 1 to 300. Default value: 5. NOTE: If the value of the HealthCHeckTimeout parameter is smaller than that of the HealthCheckInterval parameter, the value of the HealthCHeckTimeout parameter is ignored and the value of the HealthCheckInterval parameter is regarded as the timeout period.
HealthyThreshold int
The number of health checks that an unhealthy backend server must pass consecutively before it is declared healthy. In this case, the health check state is changed from fail to success. Valid values: 2 to 10. Default value: 3.
UnhealthyThreshold int
The number of consecutive health checks that a healthy backend server must consecutively fail before it is declared unhealthy. In this case, the health check state is changed from success to fail. Valid values: 2 to 10. Default value: 3.
healthCheckCodes string[]
The status code for a successful health check. Multiple status codes can be specified as a list. Valid values: http_2xx, http_3xx, http_4xx, and http_5xx. Default value: http_2xx. NOTE: This parameter exists if the HealthCheckProtocol parameter is set to HTTP.
healthCheckConnectPort number
The port of the backend server that is used for health checks. Valid values: 0 to 65535. Default value: 0. A value of 0 indicates that a backend server port is used for health checks.
healthCheckEnabled boolean
Indicates whether health checks are enabled. Valid values: true, false. Default value: true.
healthCheckHost string
The domain name that is used for health checks.
healthCheckHttpVersion string
HTTP protocol version. Valid values: HTTP1.0 and HTTP1.1. Default value: HTTP1.1 . NOTE: This parameter exists if the HealthCheckProtocol parameter is set to HTTP.
healthCheckInterval number
The time interval between two consecutive health checks. Unit: seconds. Valid values: 1 to 50. Default value: 2.
healthCheckMethod string
Health check method. Valid values: GET and HEAD. Default: GET. NOTE: This parameter exists if the HealthCheckProtocol parameter is set to HTTP.
healthCheckPath string
The forwarding rule path of health checks. NOTE: This parameter exists if the HealthCheckProtocol parameter is set to HTTP.
healthCheckProtocol string
Health check protocol. Valid values: HTTP and TCP.
healthCheckTimeout number
The timeout period of 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. Valid values: 1 to 300. Default value: 5. NOTE: If the value of the HealthCHeckTimeout parameter is smaller than that of the HealthCheckInterval parameter, the value of the HealthCHeckTimeout parameter is ignored and the value of the HealthCheckInterval parameter is regarded as the timeout period.
healthyThreshold number
The number of health checks that an unhealthy backend server must pass consecutively before it is declared healthy. In this case, the health check state is changed from fail to success. Valid values: 2 to 10. Default value: 3.
unhealthyThreshold number
The number of consecutive health checks that a healthy backend server must consecutively fail before it is declared unhealthy. In this case, the health check state is changed from success to fail. Valid values: 2 to 10. Default value: 3.
health_check_codes Sequence[str]
The status code for a successful health check. Multiple status codes can be specified as a list. Valid values: http_2xx, http_3xx, http_4xx, and http_5xx. Default value: http_2xx. NOTE: This parameter exists if the HealthCheckProtocol parameter is set to HTTP.
health_check_connect_port int
The port of the backend server that is used for health checks. Valid values: 0 to 65535. Default value: 0. A value of 0 indicates that a backend server port is used for health checks.
health_check_enabled bool
Indicates whether health checks are enabled. Valid values: true, false. Default value: true.
health_check_host str
The domain name that is used for health checks.
health_check_http_version str
HTTP protocol version. Valid values: HTTP1.0 and HTTP1.1. Default value: HTTP1.1 . NOTE: This parameter exists if the HealthCheckProtocol parameter is set to HTTP.
health_check_interval int
The time interval between two consecutive health checks. Unit: seconds. Valid values: 1 to 50. Default value: 2.
health_check_method str
Health check method. Valid values: GET and HEAD. Default: GET. NOTE: This parameter exists if the HealthCheckProtocol parameter is set to HTTP.
health_check_path str
The forwarding rule path of health checks. NOTE: This parameter exists if the HealthCheckProtocol parameter is set to HTTP.
health_check_protocol str
Health check protocol. Valid values: HTTP and TCP.
health_check_timeout int
The timeout period of 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. Valid values: 1 to 300. Default value: 5. NOTE: If the value of the HealthCHeckTimeout parameter is smaller than that of the HealthCheckInterval parameter, the value of the HealthCHeckTimeout parameter is ignored and the value of the HealthCheckInterval parameter is regarded as the timeout period.
healthy_threshold int
The number of health checks that an unhealthy backend server must pass consecutively before it is declared healthy. In this case, the health check state is changed from fail to success. Valid values: 2 to 10. Default value: 3.
unhealthy_threshold int
The number of consecutive health checks that a healthy backend server must consecutively fail before it is declared unhealthy. In this case, the health check state is changed from success to fail. Valid values: 2 to 10. Default value: 3.

ServerGroupServer

Description string
The description of the server.
Port int
The port that is used by the server. Valid values: 1 to 65535.
ServerId string
The ID of the ECS instance, ENI instance or ECI instance.
ServerIp string
The IP address of the ENI instance when it is in the inclusive ENI mode.
ServerType string
The type of the server. The type of the server. Valid values: Ecs, Eni and Eci.
Status string
The status of the resource.
Weight int
The weight of the server. Valid values: 0 to 100. Default value: 100. If the value is set to 0, no requests are forwarded to the server.
Description string
The description of the server.
Port int
The port that is used by the server. Valid values: 1 to 65535.
ServerId string
The ID of the ECS instance, ENI instance or ECI instance.
ServerIp string
The IP address of the ENI instance when it is in the inclusive ENI mode.
ServerType string
The type of the server. The type of the server. Valid values: Ecs, Eni and Eci.
Status string
The status of the resource.
Weight int
The weight of the server. Valid values: 0 to 100. Default value: 100. If the value is set to 0, no requests are forwarded to the server.
description string
The description of the server.
port number
The port that is used by the server. Valid values: 1 to 65535.
serverId string
The ID of the ECS instance, ENI instance or ECI instance.
serverIp string
The IP address of the ENI instance when it is in the inclusive ENI mode.
serverType string
The type of the server. The type of the server. Valid values: Ecs, Eni and Eci.
status string
The status of the resource.
weight number
The weight of the server. Valid values: 0 to 100. Default value: 100. If the value is set to 0, no requests are forwarded to the server.
description str
The description of the server.
port int
The port that is used by the server. Valid values: 1 to 65535.
server_id str
The ID of the ECS instance, ENI instance or ECI instance.
server_ip str
The IP address of the ENI instance when it is in the inclusive ENI mode.
server_type str
The type of the server. The type of the server. Valid values: Ecs, Eni and Eci.
status str
The status of the resource.
weight int
The weight of the server. Valid values: 0 to 100. Default value: 100. If the value is set to 0, no requests are forwarded to the server.

ServerGroupStickySessionConfig

Cookie string
the cookie that is configured on the server. NOTE: This parameter exists if the StickySession parameter is set to On and the StickySessionType parameter is set to server.
CookieTimeout int
The timeout period of a cookie. The timeout period of a cookie. Unit: seconds. Valid values: 1 to 86400. Default value: 1000.
StickySessionEnabled bool
Indicates whether sticky session is enabled. Values: true and false. Default value: false. NOTE: This parameter exists if the StickySession parameter is set to On.
StickySessionType string
The method that is used to handle a cookie. Values: Server and Insert.
Cookie string
the cookie that is configured on the server. NOTE: This parameter exists if the StickySession parameter is set to On and the StickySessionType parameter is set to server.
CookieTimeout int
The timeout period of a cookie. The timeout period of a cookie. Unit: seconds. Valid values: 1 to 86400. Default value: 1000.
StickySessionEnabled bool
Indicates whether sticky session is enabled. Values: true and false. Default value: false. NOTE: This parameter exists if the StickySession parameter is set to On.
StickySessionType string
The method that is used to handle a cookie. Values: Server and Insert.
cookie string
the cookie that is configured on the server. NOTE: This parameter exists if the StickySession parameter is set to On and the StickySessionType parameter is set to server.
cookieTimeout number
The timeout period of a cookie. The timeout period of a cookie. Unit: seconds. Valid values: 1 to 86400. Default value: 1000.
stickySessionEnabled boolean
Indicates whether sticky session is enabled. Values: true and false. Default value: false. NOTE: This parameter exists if the StickySession parameter is set to On.
stickySessionType string
The method that is used to handle a cookie. Values: Server and Insert.
cookie str
the cookie that is configured on the server. NOTE: This parameter exists if the StickySession parameter is set to On and the StickySessionType parameter is set to server.
cookie_timeout int
The timeout period of a cookie. The timeout period of a cookie. Unit: seconds. Valid values: 1 to 86400. Default value: 1000.
sticky_session_enabled bool
Indicates whether sticky session is enabled. Values: true and false. Default value: false. NOTE: This parameter exists if the StickySession parameter is set to On.
sticky_session_type str
The method that is used to handle a cookie. Values: Server and Insert.

Import

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

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

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.