Skip to content
This repository was archived by the owner on Jul 3, 2023. It is now read-only.

#77 use name variable to join specific ecs-cluster - #78

Merged
achille-roussel merged 1 commit into
segmentio:masterfrom
andersonkyle:master
Apr 20, 2017
Merged

achille-roussel merged 1 commit into
segmentio:masterfrom
andersonkyle:master

Conversation

@andersonkyle

Copy link
Copy Markdown
Contributor

Fixes #77 by using the name variable to join a specific ecs-cluster. This is accomplished by setting the ECS_CLUSTER environment variable.

@gregwebs

Copy link
Copy Markdown
Contributor

@andersonkyle

Copy link
Copy Markdown
Contributor Author

@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.

@gregwebs

Copy link
Copy Markdown
Contributor

Agreed that this makes sense. I initially ran into this issue because I didn't build off the packer image.
Its awesome that this setup comes with a packer image, but I don't think it should be required that everyone use it.

@sherzberg sherzberg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this worked for me with the latest aws provided ami

@nmarcetic

Copy link
Copy Markdown

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.

@achille-roussel

Copy link
Copy Markdown
Contributor

Apologies for the delay, this slipped out of sight. The changes look good, thanks for your contributions guys!

@achille-roussel
achille-roussel merged commit 2533651 into segmentio:master Apr 20, 2017
@nmarcetic

Copy link
Copy Markdown

Thanks @achille-roussel

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants