Alibaba Cloud
AlbServerGroupAttachment
Attaches/Detaches alb server group to a specified scaling group.
For information about alb server group attachment, see AttachAlbServerGroups.
NOTE: If scaling group’s network type is
VPC
, the alb server groups must be in the sameVPC
.
NOTE: Alb server group attachment is defined uniquely by
scaling_group_id
,alb_server_group_id
,port
.
NOTE: Resource
alicloud.ess.AlbServerGroupAttachment
don’t support modification.
NOTE: Resource
alicloud.ess.AlbServerGroupAttachment
is available in 1.158.0+.
Example Usage
Coming soon!
Coming soon!
Coming soon!
Coming soon!
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "testAccEssAlbServerGroupsAttachment";
const defaultZones = alicloud.getZones({
availableDiskCategory: "cloud_efficiency",
availableResourceCreation: "VSwitch",
});
const defaultNetwork = new alicloud.vpc.Network("defaultNetwork", {cidrBlock: "172.16.0.0/16"});
const defaultSwitch = new alicloud.vpc.Switch("defaultSwitch", {
vpcId: defaultNetwork.id,
cidrBlock: "172.16.0.0/24",
zoneId: defaultZones.then(defaultZones => defaultZones.zones?[0]?.id),
});
const defaultServerGroup = new alicloud.alb.ServerGroup("defaultServerGroup", {
loadBalancerId: alicloud_slb_load_balancer["default"].id,
name: "test",
});
const defaultScalingGroup = new alicloud.ess.ScalingGroup("defaultScalingGroup", {
minSize: "2",
maxSize: "2",
scalingGroupName: name,
vswitchIds: [defaultSwitch.id],
});
const defaultScalingConfiguration = new alicloud.ess.ScalingConfiguration("defaultScalingConfiguration", {
scalingGroupId: defaultScalingGroup.id,
imageId: data.alicloud_images["default"].images[0].id,
instanceType: data.alicloud_instance_types["default"].instance_types[0].id,
securityGroupId: alicloud_security_group["default"].id,
forceDelete: true,
active: true,
enable: true,
});
const defaultAlb_serverGroupServerGroup = new alicloud.alb.ServerGroup("defaultAlb/serverGroupServerGroup", {
serverGroupName: name,
vpcId: defaultNetwork.id,
healthCheckConfig: {
healthCheckEnabled: "false",
},
stickySessionConfig: {
stickySessionEnabled: true,
cookie: "tf-testAcc",
stickySessionType: "Server",
},
});
const defaultAlbServerGroupAttachment = new alicloud.ess.AlbServerGroupAttachment("defaultAlbServerGroupAttachment", {
scalingGroupId: defaultScalingGroup.id,
albServerGroupId: defaultServerGroup.id,
port: 9000,
weight: 50,
forceAttach: true,
}, {
dependsOn: ["alicloud_ess_scaling_configuration.default"],
});
Coming soon!
Create a AlbServerGroupAttachment Resource
new AlbServerGroupAttachment(name: string, args: AlbServerGroupAttachmentArgs, opts?: CustomResourceOptions);
@overload
def AlbServerGroupAttachment(resource_name: str,
opts: Optional[ResourceOptions] = None,
alb_server_group_id: Optional[str] = None,
force_attach: Optional[bool] = None,
port: Optional[int] = None,
scaling_group_id: Optional[str] = None,
weight: Optional[int] = None)
@overload
def AlbServerGroupAttachment(resource_name: str,
args: AlbServerGroupAttachmentArgs,
opts: Optional[ResourceOptions] = None)
func NewAlbServerGroupAttachment(ctx *Context, name string, args AlbServerGroupAttachmentArgs, opts ...ResourceOption) (*AlbServerGroupAttachment, error)
public AlbServerGroupAttachment(string name, AlbServerGroupAttachmentArgs args, CustomResourceOptions? opts = null)
public AlbServerGroupAttachment(String name, AlbServerGroupAttachmentArgs args)
public AlbServerGroupAttachment(String name, AlbServerGroupAttachmentArgs args, CustomResourceOptions options)
type: alicloud:ess:AlbServerGroupAttachment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AlbServerGroupAttachmentArgs
- 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 AlbServerGroupAttachmentArgs
- 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 AlbServerGroupAttachmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AlbServerGroupAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AlbServerGroupAttachmentArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
AlbServerGroupAttachment 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 AlbServerGroupAttachment resource accepts the following input properties:
- Alb
Server stringGroup Id ID of Alb Server Group.
- Port int
- The port will be used for Alb Server Group backend server.
- Scaling
Group stringId ID of the scaling group.
- Weight int
The weight of an ECS instance attached to the Alb Server Group.
- Force
Attach bool If instances of scaling group are attached/removed from slb backend server when attach/detach alb server group from scaling group. Default to false.
- Alb
Server stringGroup Id ID of Alb Server Group.
- Port int
- The port will be used for Alb Server Group backend server.
- Scaling
Group stringId ID of the scaling group.
- Weight int
The weight of an ECS instance attached to the Alb Server Group.
- Force
Attach bool If instances of scaling group are attached/removed from slb backend server when attach/detach alb server group from scaling group. Default to false.
- alb
Server StringGroup Id ID of Alb Server Group.
- port Integer
- The port will be used for Alb Server Group backend server.
- scaling
Group StringId ID of the scaling group.
- weight Integer
The weight of an ECS instance attached to the Alb Server Group.
- force
Attach Boolean If instances of scaling group are attached/removed from slb backend server when attach/detach alb server group from scaling group. Default to false.
- alb
Server stringGroup Id ID of Alb Server Group.
- port number
- The port will be used for Alb Server Group backend server.
- scaling
Group stringId ID of the scaling group.
- weight number
The weight of an ECS instance attached to the Alb Server Group.
- force
Attach boolean If instances of scaling group are attached/removed from slb backend server when attach/detach alb server group from scaling group. Default to false.
- alb_
server_ strgroup_ id ID of Alb Server Group.
- port int
- The port will be used for Alb Server Group backend server.
- scaling_
group_ strid ID of the scaling group.
- weight int
The weight of an ECS instance attached to the Alb Server Group.
- force_
attach bool If instances of scaling group are attached/removed from slb backend server when attach/detach alb server group from scaling group. Default to false.
- alb
Server StringGroup Id ID of Alb Server Group.
- port Number
- The port will be used for Alb Server Group backend server.
- scaling
Group StringId ID of the scaling group.
- weight Number
The weight of an ECS instance attached to the Alb Server Group.
- force
Attach Boolean If instances of scaling group are attached/removed from slb backend server when attach/detach alb server group from scaling group. Default to false.
Outputs
All input properties are implicitly available as output properties. Additionally, the AlbServerGroupAttachment 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 string
The provider-assigned unique ID for this managed resource.
- id str
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
Look up an Existing AlbServerGroupAttachment Resource
Get an existing AlbServerGroupAttachment 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?: AlbServerGroupAttachmentState, opts?: CustomResourceOptions): AlbServerGroupAttachment
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
alb_server_group_id: Optional[str] = None,
force_attach: Optional[bool] = None,
port: Optional[int] = None,
scaling_group_id: Optional[str] = None,
weight: Optional[int] = None) -> AlbServerGroupAttachment
func GetAlbServerGroupAttachment(ctx *Context, name string, id IDInput, state *AlbServerGroupAttachmentState, opts ...ResourceOption) (*AlbServerGroupAttachment, error)
public static AlbServerGroupAttachment Get(string name, Input<string> id, AlbServerGroupAttachmentState? state, CustomResourceOptions? opts = null)
public static AlbServerGroupAttachment get(String name, Output<String> id, AlbServerGroupAttachmentState 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.
- Alb
Server stringGroup Id ID of Alb Server Group.
- Force
Attach bool If instances of scaling group are attached/removed from slb backend server when attach/detach alb server group from scaling group. Default to false.
- Port int
- The port will be used for Alb Server Group backend server.
- Scaling
Group stringId ID of the scaling group.
- Weight int
The weight of an ECS instance attached to the Alb Server Group.
- Alb
Server stringGroup Id ID of Alb Server Group.
- Force
Attach bool If instances of scaling group are attached/removed from slb backend server when attach/detach alb server group from scaling group. Default to false.
- Port int
- The port will be used for Alb Server Group backend server.
- Scaling
Group stringId ID of the scaling group.
- Weight int
The weight of an ECS instance attached to the Alb Server Group.
- alb
Server StringGroup Id ID of Alb Server Group.
- force
Attach Boolean If instances of scaling group are attached/removed from slb backend server when attach/detach alb server group from scaling group. Default to false.
- port Integer
- The port will be used for Alb Server Group backend server.
- scaling
Group StringId ID of the scaling group.
- weight Integer
The weight of an ECS instance attached to the Alb Server Group.
- alb
Server stringGroup Id ID of Alb Server Group.
- force
Attach boolean If instances of scaling group are attached/removed from slb backend server when attach/detach alb server group from scaling group. Default to false.
- port number
- The port will be used for Alb Server Group backend server.
- scaling
Group stringId ID of the scaling group.
- weight number
The weight of an ECS instance attached to the Alb Server Group.
- alb_
server_ strgroup_ id ID of Alb Server Group.
- force_
attach bool If instances of scaling group are attached/removed from slb backend server when attach/detach alb server group from scaling group. Default to false.
- port int
- The port will be used for Alb Server Group backend server.
- scaling_
group_ strid ID of the scaling group.
- weight int
The weight of an ECS instance attached to the Alb Server Group.
- alb
Server StringGroup Id ID of Alb Server Group.
- force
Attach Boolean If instances of scaling group are attached/removed from slb backend server when attach/detach alb server group from scaling group. Default to false.
- port Number
- The port will be used for Alb Server Group backend server.
- scaling
Group StringId ID of the scaling group.
- weight Number
The weight of an ECS instance attached to the Alb Server Group.
Import
ESS alb server groups can be imported using the id, e.g.
$ pulumi import alicloud:ess/albServerGroupAttachment:AlbServerGroupAttachment example asg-xxx:sgp-xxx:5000
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.