title: Attaching ELB to ASG in Private Subnet
body: <p>Thanks for your time in advance. I am pretty new to AWS and trying to setup a cloud facing application processing HTTP / HTTPS requests.</p>
  
  <p>I have a <em>domain-name (example.com) attached to the Elastic Load Balancer (ELB)</em> and my requirement is just to have a <em>ELB attached to a AutoScaling group (ASG)</em> which would have a min-max of 2-5 EC2s. <em>Preferably I would want to place my EC2s created by ASG to be placed in a private subnet.</em></p>
  
  <p>I was following the solution provided <a href="https://stackoverflow.com/questions/9257514/amazon-elb-in-vpc">here</a>, but as I understand in step 5, it is for connecting the ELB to existing EC2 instances. But my requirement is to attach it to a ASG and hence cannot connect to specific EC2 instances. </p>
  
  <p>I am focusing on just two AZ for now and created a public and private subnet each in both the AZ. After creating the ELB and attaching it to two public subnets, I proceeded for Launch-Configuration &amp; ASG. I would request some clarification on the implication of the following selections while setting up the LC and ASG.</p>
  
  <p>While creating a Launch Configuration for an ASG, in one of the steps (IP Address Type) I have <strong>three</strong> options, namely: </p>
  
  <p>(1) Give Public IP to new instances if created in default VPC/SubNet</p>
  
  <p>(2) Always Public IP for new instances</p>
  
  <p>(3) No Public IP for new instances.</p>
  
  <p><em>Which one of the above should be selected given my requirement?</em></p>
  
  <p><strong>Additional Questions</strong></p>
  
  <ol>
  <li><p>When selecting the subnets while creating ASG, should I select <em>both public and private subnets</em> or <em>only public SN</em> or <em>only Private SN</em> ? My guess was Private subnet only as I wanted to place the EC2 in private SN.</p></li>
  <li><p>If the EC2s created by the ASG will be deployed in Private SN, what else should be present in the public subnet?</p></li>
  </ol>
  
  <p>Thanks again for your time and guidance.</p>
  
  <p><strong>Update on 6/13</strong></p>
  
  <p>For the questions I had posted above, I went ahead with choices as below:</p>
  
  <ol>
  <li><p>While creating a Launch Configuration for an ASG, IP Address Type : No Public IP for new instances.</p></li>
  <li><p>When selecting the subnets while creating ASG : Only Private SN</p></li>
  <li><p>I placed a NAT Gateway in the public subnet and updated the routing table of Private Subnet to include a route for 0.0.0.0/0 to NAT</p></li>
  </ol>
  
  <p><strong>Things are working now !!</strong></p>