Class 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+.
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",
},
},
},
},
});
}
}
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.
Inherited Members
Namespace: Pulumi.AliCloud.Ess
Assembly: Pulumi.AliCloud.dll
Syntax
public class ScalingGroupVServerGroups : CustomResource
Constructors
View SourceScalingGroupVServerGroups(String, ScalingGroupVServerGroupsArgs, CustomResourceOptions)
Create a ScalingGroupVServerGroups resource with the given unique name, arguments, and options.
Declaration
public ScalingGroupVServerGroups(string name, ScalingGroupVServerGroupsArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| ScalingGroupVServerGroupsArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceForce
If instances of scaling group are attached/removed from slb backend server when attach/detach vserver group from scaling group. Default to true.
Declaration
public Output<bool?> Force { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
ScalingGroupId
ID of the scaling group.
Declaration
public Output<string> ScalingGroupId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
VserverGroups
A list of vserver groups attached on scaling group. See Block vserver_group below for details.
Declaration
public Output<ImmutableArray<ScalingGroupVServerGroupsVserverGroup>> VserverGroups { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<ScalingGroupVServerGroupsVserverGroup>> |
Methods
View SourceGet(String, Input<String>, ScalingGroupVServerGroupsState, CustomResourceOptions)
Get an existing ScalingGroupVServerGroups resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static ScalingGroupVServerGroups Get(string name, Input<string> id, ScalingGroupVServerGroupsState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| ScalingGroupVServerGroupsState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| ScalingGroupVServerGroups |