ScalingGroupVServerGroups
Attaches/Detaches vserver groups to a specified scaling group.
NOTE: The load balancer of which vserver groups belongs to must be in
activestatus.NOTE: If scaling group’s network type is
VPC, the vserver groups must be in the sameVPC.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
weightattribute means detach vserver group first and then, attach with new weight parameter.NOTE: Resource
alicloud.ess.ScalingGroupVServerGroupsis 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
new ScalingGroupVServerGroups(name: string, args: ScalingGroupVServerGroupsArgs, opts?: CustomResourceOptions);def ScalingGroupVServerGroups(resource_name, opts=None, force=None, scaling_group_id=None, vserver_groups=None, __props__=None);func NewScalingGroupVServerGroups(ctx *Context, name string, args ScalingGroupVServerGroupsArgs, opts ...ResourceOption) (*ScalingGroupVServerGroups, error)public ScalingGroupVServerGroups(string name, ScalingGroupVServerGroupsArgs args, CustomResourceOptions? opts = null)- 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:
- Scaling
Group stringId ID of the scaling group.
- Vserver
Groups List<Pulumi.Ali Cloud. Ess. Inputs. Scaling Group VServer Groups Vserver Group Args> 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 stringId ID of the scaling group.
- Vserver
Groups []ScalingGroup VServer Groups Vserver Group 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 stringId ID of the scaling group.
- vserver
Groups ScalingGroup VServer Groups Vserver Group[] 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_ strid ID of the scaling group.
- vserver_
groups List[ScalingGroup VServer Groups Vserver Group] 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:
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.
public static get(name: string, id: Input<ID>, state?: ScalingGroupVServerGroupsState, opts?: CustomResourceOptions): ScalingGroupVServerGroupsstatic 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)public static ScalingGroupVServerGroups Get(string name, Input<string> id, ScalingGroupVServerGroupsState? 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:
- 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 stringId ID of the scaling group.
- Vserver
Groups List<Pulumi.Ali Cloud. Ess. Inputs. Scaling Group VServer Groups Vserver Group Args> 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 stringId ID of the scaling group.
- Vserver
Groups []ScalingGroup VServer Groups Vserver Group 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 stringId ID of the scaling group.
- vserver
Groups ScalingGroup VServer Groups Vserver Group[] 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_ strid ID of the scaling group.
- vserver_
groups List[ScalingGroup VServer Groups Vserver Group] A list of vserver groups attached on scaling group. See Block vserver_group below for details.
Supporting Types
ScalingGroupVServerGroupsVserverGroup
ScalingGroupVServerGroupsVserverGroupVserverAttribute
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.