title: Why can't my ECS service register available EC2 instances with my ELB?
body: <p>I've got an EC2 launch configuration that builds the ECS optimized AMI. I've got an auto scaling group that ensures that I've got at least two available instances at all times. Finally, I've got a load balancer.</p>
  
  <p>I'm trying to create an ECS service that distributes my tasks across the instances in the load balancer.</p>
  
  <p>After reading the documentation for ECS load balancing, it's my understanding that my ASG should not automatically register my EC2 instances with the ELB, because ECS takes care of that. So, my ASG does not specify an ELB. Likewise, my ELB does not have any registered EC2 instances.</p>
  
  <p>When I create my ECS service, I choose the ELB and also select the ecsServiceRole. After creating the service, I never see any instances available in the ECS Instances tab. The service also fails to start any tasks, with a very generic error of ...</p>
  
  <p><em>service was unable to place a task because the resources could not be found.</em></p>
  
  <p>I've been at this for about two days now and can't seem to figure out what configuration settings are not properly configured. Does anybody have any ideas as to what might be causing this to not work?</p>
  
  <p><strong>Update @ 06/25/2015:</strong></p>
  
  <p>I think this may have something to do with the <code>ECS_CLUSTER</code> user data setting. </p>
  
  <p>In my EC2 auto scaling launch configuration, if I leave the user data input completely empty, the instances are created with an <code>ECS_CLUSTER</code> value of "default". When this happens, I see an automatically-created cluster, named "default". In this default cluster, I see the instances and can register tasks with the ELB like expected. My ELB health check (HTTP) passes once the tasks are registered with the ELB and all is good in the world.</p>
  
  <p>But, if I change that <code>ECS_CLUSTER</code> setting to something custom I never see a cluster created with that name. If I manually create a cluster with that name, the instances never become visible within the cluster. I can't ever register tasks with the ELB in this scenario.</p>
  
  <p>Any ideas?</p>