-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
provider/aws: Add top-level ELB Attachment resource #3999
Comments
@phinze: thanks for filing this, that would definitely solve my problem. From the way ELBs are configured, it should also be fairly straightforward as creation and instance-registration are different steps. |
I have the same problem when i want to run my configuration with Amazon recommended rules |
We have a similar use case, but then with auto scaling groups in stead of instances. To add SSL certificates for new domains, we are adding new ELBs. These ELBs point to existing ASGs. The ASGs are generic infrastructure that are shared between applications, while the new ELBs are application specific. We are currently trying to modularize our terraform codebase. We would like to create separate plans to create the ASGs and ELBs, where the ASGs are created before the ELBs exist. Currently this is not possible because the the ELBs have to be passed in the An ELB attachment resource would help us out greatly, when it also could support ASGs. |
To expand on @amochtar's use case, here's an example where # proposal
resource "aws_autoscaling_group" "docker_hosts" {
# no load_balancers field specified
}
resource "docker_image" "app" {
count = "${var.count}"
name = "nginx"
lifecycle {
create_before_destroy = true
}
}
resource "docker_container" "app" {
count = "${var.count}"
image = "${docker_image.app}"
ports {
external = "${var.container_port}"
internal = "80"
}
lifecycle {
create_before_destroy = true
}
}
resource "aws_elb" "app" {
depends_on = ["docker_container.app"]
listener {
lb_port = "80"
lb_protocol = "http"
instance_port = "${var.container_port}"
instance_protocol = "http"
}
# no instances field specified
}
resource "aws_elb_attachment" "app" {
elb = "${aws_elb.app.id}"
autoscaling_group = "${aws_autoscaling_group.docker_hosts.id}"
wait_for_elb_capacity = 1
} |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Based on an ML discussion:
https://groups.google.com/d/msgid/terraform-tool/e9ef8081-db96-4329-9b62-adf8c0b40c81%40googlegroups.com
It seems like it might be worth splitting out instance <-> ELB attachments as their own resource, in the way that we've done in several other scenarios now.
The use case from the thread is the desire to be able to create an ELB w/ instances and to have provisioners on the instances reference details about the ELB. You can't do that today w/o a cycle because the only way to attach instances to an ELB is via the
instances
parameter onaws_elb
.If we had a top level attachment resource you could do something like this:
The text was updated successfully, but these errors were encountered: