-
Notifications
You must be signed in to change notification settings - Fork 187
Using aws_autoscaling_attachment
#19
Comments
Use `aws_autoscaling_attachment` instead. Fixes hashicorp#19
Use `aws_autoscaling_attachment` instead. Fixes hashicorp#19
Could you describe your use case?
If you had both, yes, they would overwrite each other. Is there a reason you can't use the existing |
Currently, I have a module that provisions Consul and Nomad clusters using the this module and the other Consul module that you maintain. I then have a separate module that provisions an ELB and that is backed by the Nomad clients ASG. I would like to be able to "attach" the ELB to the Nomad clients ASG without having to modify the module that provisions the Consul/Nomad clusters. So instead of having the two modules have some sort of circular dependency (if that's even possible?), I would simply like the second module implicitly depend on the first module. Hope this makes sense. |
@brikis98 May I know what your view on this is? |
I'm still a bit confused about why the existing approach doesn't work. module "consule_and_nomad_servers" {
source = "..."
}
module "nomad_clients" {
source = "..."
} Is this the general structure you have? Is the ELB defined in the |
I have a module that sets up Nomad and Consul. module "consule_and_nomad_servers" {
source = "..."
}
module "nomad_clients" {
source = "..."
} Separately, I have a different module that sets up the ELB. This second module only accesses the first module via data "terraform_remote_state" "nomad" {
// ...
}
resource "aws_elb" "nomad" {
// ...
}
resource "aws_autoscaling_attachment" "nomad" {
autoscaling_group_name = "${data.terraform_remote_state.nomad.nomad_asg_id}" // etc
// ,,,
}
So basically, these two modules are provisioned via separate |
Ah, that's the key info I was missing 👍 And I guess the issue you're hitting is if you attach an ELB using the existing |
Sorry I missed out some context earlier.
Yep. Basically, they are setting/unsetting each other during consecutive applies. |
OK, understood. In that case, yes, I think a PR to switch to the Thx! |
I've opened #23 with some migration instruction. |
I would like to be able to attach an ELB to the auto scaling group after the initial creation of the ASG using the
aws_autoscaling_attachment
resource.However, the current implementation sets
target_group_arns
andload_balancers
in theaws_autoscaling_group
resource. These two usage would overwrite each other.I would like to propose that we remove setting these two arguments in the
aws_autoscaling_group
and let users use theaws_autoscaling_attachment
resource instead. (Sadly there is no "unset" functionality in Terraform AFAIK) I would argue that usingaws_autoscaling_attachment
is more flexible.This would, unfortunately, be a breaking change.
The text was updated successfully, but these errors were encountered: