ScalingGroupVServerGroups

Attaches/Detaches vserver groups to a specified scaling group.

NOTE: The load balancer of which vserver groups belongs to must be in active status.

NOTE: If scaling group’s network type is VPC, the vserver groups must be in the same VPC.

NOTE: A scaling group can have at most 5 vserver groups attached by default.

NOTE: Vserver groups and the default group of loadbalancer share the same backend server quota.

NOTE: When attach vserver groups to scaling group, existing ECS instances will be added to vserver groups; Instead, ECS instances will be removed from vserver group when detach.

NOTE: Detach action will be executed before attach action.

NOTE: Vserver group is defined uniquely by loadbalancer_id, vserver_group_id, port.

NOTE: Modifing weight attribute means detach vserver group first and then, attach with new weight parameter.

NOTE: Resource alicloud.ess.ScalingGroupVServerGroups is available in 1.53.0+.

Block vserver_group

the vserver_group supports the following:

  • loadbalancer_id - (Required) Loadbalancer server ID of VServer Group.
  • vserver_attributes - (Required) A list of VServer Group attributes. See Block vserver_attribute below for details.

Block vserver_attribute

  • vserver_group_id - (Required) ID of VServer Group.
  • port - (Required) - The port will be used for VServer Group backend server.
  • weight - (Required) The weight of an ECS instance attached to the VServer Group.

Example Usage

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

class MyStack : Stack
{
    public MyStack()
    {
        var config = new Config();
        var name = config.Get("name") ?? "testAccEssVserverGroupsAttachment";
        var defaultZones = Output.Create(AliCloud.GetZones.InvokeAsync(new AliCloud.GetZonesArgs
        {
            AvailableDiskCategory = "cloud_efficiency",
            AvailableResourceCreation = "VSwitch",
        }));
        var defaultNetwork = new AliCloud.Vpc.Network("defaultNetwork", new AliCloud.Vpc.NetworkArgs
        {
            CidrBlock = "172.16.0.0/16",
        });
        var defaultSwitch = new AliCloud.Vpc.Switch("defaultSwitch", new AliCloud.Vpc.SwitchArgs
        {
            AvailabilityZone = defaultZones.Apply(defaultZones => defaultZones.Zones[0].Id),
            CidrBlock = "172.16.0.0/24",
            VpcId = defaultNetwork.Id,
        });
        var defaultLoadBalancer = new AliCloud.Slb.LoadBalancer("defaultLoadBalancer", new AliCloud.Slb.LoadBalancerArgs
        {
            VswitchId = defaultSwitch.Id,
        });
        var defaultServerGroup = new AliCloud.Slb.ServerGroup("defaultServerGroup", new AliCloud.Slb.ServerGroupArgs
        {
            LoadBalancerId = defaultLoadBalancer.Id,
        });
        var defaultListener = new List<AliCloud.Slb.Listener>();
        for (var rangeIndex = 0; rangeIndex < 2; rangeIndex++)
        {
            var range = new { Value = rangeIndex };
            defaultListener.Add(new AliCloud.Slb.Listener($"defaultListener-{range.Value}", new AliCloud.Slb.ListenerArgs
            {
                BackendPort = 22,
                Bandwidth = 10,
                FrontendPort = 22,
                HealthCheckType = "tcp",
                LoadBalancerId = 
                {
                    defaultLoadBalancer,
                }.Select(__item => __item.Id).ToList()[range.Value],
                Protocol = "tcp",
            }));
        }
        var defaultScalingGroup = new AliCloud.Ess.ScalingGroup("defaultScalingGroup", new AliCloud.Ess.ScalingGroupArgs
        {
            MaxSize = 2,
            MinSize = 2,
            ScalingGroupName = name,
            VswitchIds = 
            {
                defaultSwitch.Id,
            },
        });
        var defaultScalingGroupVServerGroups = new AliCloud.Ess.ScalingGroupVServerGroups("defaultScalingGroupVServerGroups", new AliCloud.Ess.ScalingGroupVServerGroupsArgs
        {
            ScalingGroupId = defaultScalingGroup.Id,
            VserverGroups = 
            {
                new AliCloud.Ess.Inputs.ScalingGroupVServerGroupsVserverGroupArgs
                {
                    LoadbalancerId = defaultLoadBalancer.Id,
                    VserverAttributes = 
                    {
                        new AliCloud.Ess.Inputs.ScalingGroupVServerGroupsVserverGroupVserverAttributeArgs
                        {
                            Port = 100,
                            VserverGroupId = defaultServerGroup.Id,
                            Weight = 60,
                        },
                    },
                },
            },
        });
    }

}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "testAccEssVserverGroupsAttachment"
default_zones = alicloud.get_zones(available_disk_category="cloud_efficiency",
    available_resource_creation="VSwitch")
default_network = alicloud.vpc.Network("defaultNetwork", cidr_block="172.16.0.0/16")
default_switch = alicloud.vpc.Switch("defaultSwitch",
    availability_zone=default_zones.zones[0]["id"],
    cidr_block="172.16.0.0/24",
    vpc_id=default_network.id)
default_load_balancer = alicloud.slb.LoadBalancer("defaultLoadBalancer", vswitch_id=default_switch.id)
default_server_group = alicloud.slb.ServerGroup("defaultServerGroup", load_balancer_id=default_load_balancer.id)
default_listener = []
for range in [{"value": i} for i in range(0, 2)]:
    default_listener.append(alicloud.slb.Listener(f"defaultListener-{range['value']}",
        backend_port="22",
        bandwidth="10",
        frontend_port="22",
        health_check_type="tcp",
        load_balancer_id=[__item.id for __item in [default_load_balancer]][range["value"]],
        protocol="tcp"))
default_scaling_group = alicloud.ess.ScalingGroup("defaultScalingGroup",
    max_size="2",
    min_size="2",
    scaling_group_name=name,
    vswitch_ids=[default_switch.id])
default_scaling_group_v_server_groups = alicloud.ess.ScalingGroupVServerGroups("defaultScalingGroupVServerGroups",
    scaling_group_id=default_scaling_group.id,
    vserver_groups=[{
        "loadbalancerId": default_load_balancer.id,
        "vserverAttributes": [{
            "port": "100",
            "vserver_group_id": default_server_group.id,
            "weight": "60",
        }],
    }])
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const config = new pulumi.Config();
const name = config.get("name") || "testAccEssVserverGroupsAttachment";

const defaultZones = pulumi.output(alicloud.getZones({
    availableDiskCategory: "cloud_efficiency",
    availableResourceCreation: "VSwitch",
}, { async: true }));
const defaultNetwork = new alicloud.vpc.Network("default", {
    cidrBlock: "172.16.0.0/16",
});
const defaultSwitch = new alicloud.vpc.Switch("default", {
    availabilityZone: defaultZones.zones[0].id,
    cidrBlock: "172.16.0.0/24",
    vpcId: defaultNetwork.id,
});
const defaultLoadBalancer = new alicloud.slb.LoadBalancer("default", {
    vswitchId: defaultSwitch.id,
});
const defaultServerGroup = new alicloud.slb.ServerGroup("default", {
    loadBalancerId: defaultLoadBalancer.id,
});
const defaultListener: alicloud.slb.Listener[] = [];
for (let i = 0; i < 2; i++) {
    defaultListener.push(new alicloud.slb.Listener(`default-${i}`, {
        backendPort: 22,
        bandwidth: 10,
        frontendPort: 22,
        healthCheckType: "tcp",
        loadBalancerId: defaultLoadBalancer.id.apply(id => id[i]),
        protocol: "tcp",
    }));
}
const defaultScalingGroup = new alicloud.ess.ScalingGroup("default", {
    maxSize: 2,
    minSize: 2,
    scalingGroupName: name,
    vswitchIds: [defaultSwitch.id],
});
const defaultScalingGroupVServerGroups = new alicloud.ess.ScalingGroupVServerGroups("default", {
    scalingGroupId: defaultScalingGroup.id,
    vserverGroups: [{
        loadbalancerId: defaultLoadBalancer.id,
        vserverAttributes: [{
            port: 100,
            vserverGroupId: defaultServerGroup.id,
            weight: 60,
        }],
    }],
});

Create a ScalingGroupVServerGroups Resource

def ScalingGroupVServerGroups(resource_name, opts=None, force=None, scaling_group_id=None, vserver_groups=None, __props__=None);
name string
The unique name of the resource.
args ScalingGroupVServerGroupsArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ScalingGroupVServerGroupsArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ScalingGroupVServerGroupsArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

ScalingGroupVServerGroups Resource Properties

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

Inputs

The ScalingGroupVServerGroups resource accepts the following input properties:

ScalingGroupId string

ID of the scaling group.

VserverGroups List<Pulumi.AliCloud.Ess.Inputs.ScalingGroupVServerGroupsVserverGroupArgs>

A list of vserver groups attached on scaling group. See Block vserver_group below for details.

Force bool

If instances of scaling group are attached/removed from slb backend server when attach/detach vserver group from scaling group. Default to true.

ScalingGroupId string

ID of the scaling group.

VserverGroups []ScalingGroupVServerGroupsVserverGroup

A list of vserver groups attached on scaling group. See Block vserver_group below for details.

Force bool

If instances of scaling group are attached/removed from slb backend server when attach/detach vserver group from scaling group. Default to true.

scalingGroupId string

ID of the scaling group.

vserverGroups ScalingGroupVServerGroupsVserverGroup[]

A list of vserver groups attached on scaling group. See Block vserver_group below for details.

force boolean

If instances of scaling group are attached/removed from slb backend server when attach/detach vserver group from scaling group. Default to true.

scaling_group_id str

ID of the scaling group.

vserver_groups List[ScalingGroupVServerGroupsVserverGroup]

A list of vserver groups attached on scaling group. See Block vserver_group below for details.

force bool

If instances of scaling group are attached/removed from slb backend server when attach/detach vserver group from scaling group. Default to true.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing ScalingGroupVServerGroups Resource

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

static get(resource_name, id, opts=None, force=None, scaling_group_id=None, vserver_groups=None, __props__=None);
func GetScalingGroupVServerGroups(ctx *Context, name string, id IDInput, state *ScalingGroupVServerGroupsState, opts ...ResourceOption) (*ScalingGroupVServerGroups, error)
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:

Force bool

If instances of scaling group are attached/removed from slb backend server when attach/detach vserver group from scaling group. Default to true.

ScalingGroupId string

ID of the scaling group.

VserverGroups List<Pulumi.AliCloud.Ess.Inputs.ScalingGroupVServerGroupsVserverGroupArgs>

A list of vserver groups attached on scaling group. See Block vserver_group below for details.

Force bool

If instances of scaling group are attached/removed from slb backend server when attach/detach vserver group from scaling group. Default to true.

ScalingGroupId string

ID of the scaling group.

VserverGroups []ScalingGroupVServerGroupsVserverGroup

A list of vserver groups attached on scaling group. See Block vserver_group below for details.

force boolean

If instances of scaling group are attached/removed from slb backend server when attach/detach vserver group from scaling group. Default to true.

scalingGroupId string

ID of the scaling group.

vserverGroups ScalingGroupVServerGroupsVserverGroup[]

A list of vserver groups attached on scaling group. See Block vserver_group below for details.

force bool

If instances of scaling group are attached/removed from slb backend server when attach/detach vserver group from scaling group. Default to true.

scaling_group_id str

ID of the scaling group.

vserver_groups List[ScalingGroupVServerGroupsVserverGroup]

A list of vserver groups attached on scaling group. See Block vserver_group below for details.

Supporting Types

ScalingGroupVServerGroupsVserverGroup

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

LoadbalancerId string
VserverAttributes List<Pulumi.AliCloud.Ess.Inputs.ScalingGroupVServerGroupsVserverGroupVserverAttributeArgs>
LoadbalancerId string
VserverAttributes []ScalingGroupVServerGroupsVserverGroupVserverAttribute
loadbalancerId string
vserverAttributes ScalingGroupVServerGroupsVserverGroupVserverAttribute[]
loadbalancerId str
vserverAttributes List[ScalingGroupVServerGroupsVserverGroupVserverAttribute]

ScalingGroupVServerGroupsVserverGroupVserverAttribute

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Port int
VserverGroupId string
Weight int
Port int
VserverGroupId string
Weight int
port number
vserverGroupId string
weight number
port float
vserver_group_id str
weight float

Package Details

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