Repository navigation
#77 use name variable to join specific ecs-cluster - #78
Conversation
|
Isn't this already accomplished here? https://github.com/segmentio/stack/blob/master/packer/ecs/root/etc/systemd/system/ecs-agent.service#L28 |
|
@gregwebs Yes but that's on the Packer side. IMO using stack (e.g. Terraform) shouldn't be predicated on using Packer as well. As it stands now, if you just grab the ECS-Module, all instances will join the default cluster because the module doesn't use the name variable to set ECS_CLUSTER. I don't know what the rationale was for setting ECS_CLUSTER within the Packer configuration as opposed to the cloud-init template. Environment variables are already being set there: https://github.com/segmentio/stack/blob/master/ecs-cluster/files/cloud-config.yml.tpl#L3-L5 but its using an intermediate variable SERVER_GROUP. My PR sets ECS_CLUSTER right there in the cloud-init template within the ECS-Module, the same way that ECS_ENGINE_AUTH_TYPE and ECS_ENGINE_AUTH_DATA are set. Works like a charm. |
|
Agreed that this makes sense. I initially ran into this issue because I didn't build off the packer image. |
sherzberg
left a comment
There was a problem hiding this comment.
this worked for me with the latest aws provided ami
|
Why this is not merged yet ? I am confirming @kanderson450 all my instances are added to default cluster... I am not using packer just stack modules. |
|
Apologies for the delay, this slipped out of sight. The changes look good, thanks for your contributions guys! |
|
Thanks @achille-roussel |
Fixes #77 by using the name variable to join a specific ecs-cluster. This is accomplished by setting the ECS_CLUSTER environment variable.