2016-11-03 14:08:49 +01:00
|
|
|
---
|
|
|
|
layout: "aws"
|
|
|
|
page_title: "AWS: aws_autoscaling_attachment"
|
|
|
|
sidebar_current: "docs-aws-resource-autoscaling-attachment"
|
|
|
|
description: |-
|
|
|
|
Provides an AutoScaling Group Attachment resource.
|
|
|
|
---
|
|
|
|
|
|
|
|
# aws\_autoscaling\_attachment
|
|
|
|
|
|
|
|
Provides an AutoScaling Attachment resource.
|
|
|
|
|
|
|
|
~> **NOTE on AutoScaling Groups and ASG Attachments:** Terraform currently provides
|
|
|
|
both a standalone ASG Attachment resource (describing an ASG attached to
|
|
|
|
an ELB), and an [AutoScaling Group resource](autoscaling_group.html) with
|
|
|
|
`load_balancers` defined in-line. At this time you cannot use an ASG with in-line
|
|
|
|
load balancers in conjunction with an ASG Attachment resource. Doing so will cause a
|
|
|
|
conflict and will overwrite attachments.
|
2017-03-23 10:23:23 +01:00
|
|
|
|
2016-11-03 14:08:49 +01:00
|
|
|
## Example Usage
|
|
|
|
|
|
|
|
```
|
|
|
|
# Create a new load balancer attachment
|
|
|
|
resource "aws_autoscaling_attachment" "asg_attachment_bar" {
|
|
|
|
autoscaling_group_name = "${aws_autoscaling_group.asg.id}"
|
|
|
|
elb = "${aws_elb.bar.id}"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2017-03-23 10:23:23 +01:00
|
|
|
```
|
|
|
|
# Create a new ALB Target Group attachment
|
|
|
|
resource "aws_autoscaling_attachment" "asg_attachment_bar" {
|
|
|
|
autoscaling_group_name = "${aws_autoscaling_group.asg.id}"
|
|
|
|
alb_target_group_arn = "${aws_alb_target_group.test.arn}"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2016-11-03 14:08:49 +01:00
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
|
|
|
* `autoscaling_group_name` - (Required) Name of ASG to associate with the ELB.
|
2017-03-23 10:23:23 +01:00
|
|
|
* `elb` - (Optional) The name of the ELB.
|
|
|
|
* `alb_target_group_arn` - (Optional) The ARN of an ALB Target Group.
|
2016-11-03 14:08:49 +01:00
|
|
|
|