subcategory | layout | page_title | description |
---|---|---|---|
Auto Scaling |
aws |
AWS: aws_autoscaling_attachment |
Terraform resource for managing an AWS Auto Scaling Attachment. |
Attaches a load balancer to an Auto Scaling group.
~> NOTE on Auto Scaling Groups, Attachments and Traffic Source Attachments: Terraform provides standalone Attachment (for attaching Classic Load Balancers and Application Load Balancer, Gateway Load Balancer, or Network Load Balancer target groups) and Traffic Source Attachment (for attaching Load Balancers and VPC Lattice target groups) resources and an Auto Scaling Group resource with load_balancers
, target_group_arns
and traffic_source
attributes. Do not use the same traffic source in more than one of these resources. Doing so will cause a conflict of attachments. A lifecycle
configuration block can be used to suppress differences if necessary.
# Create a new load balancer attachment
resource "aws_autoscaling_attachment" "example" {
autoscaling_group_name = aws_autoscaling_group.example.id
elb = aws_elb.example.id
}
# Create a new ALB Target Group attachment
resource "aws_autoscaling_attachment" "example" {
autoscaling_group_name = aws_autoscaling_group.example.id
lb_target_group_arn = aws_lb_target_group.example.arn
}
This resource supports the following arguments:
autoscaling_group_name
- (Required) Name of ASG to associate with the ELB.elb
- (Optional) Name of the ELB.lb_target_group_arn
- (Optional) ARN of a load balancer target group.
This resource exports no additional attributes.