Skip to content

Resource: awsElbAttachment

Attaches an EC2 instance to an Elastic Load Balancer (ELB). For attaching resources with Application Load Balancer (ALB) or Network Load Balancer (NLB), see the awsLbTargetGroupAttachment resource.

\~> NOTE on ELB Instances and ELB Attachments: Terraform currently provides both a standalone ELB Attachment resource (describing an instance attached to an ELB), and an Elastic Load Balancer resource with instances defined in-line. At this time you cannot use an ELB with in-line instances in conjunction with an ELB Attachment resource. Doing so will cause a conflict and will overwrite attachments.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.elbAttachment.ElbAttachment(this, "baz", {
  elb: "${aws_elb.bar.id}",
  instance: "${aws_instance.foo.id}",
});

Argument Reference

The following arguments are supported:

  • elb - (Required) The name of the ELB.
  • instance - (Required) Instance ID to place in the ELB pool.

Attributes Reference

No additional attributes are exported.