title: Can I use AWS code Deploy for pulling application code while autoscaling?
body: <p>I want to autoscale the infrastructure when load gets high. I am running my infrastructure on <code>AWS</code>. I have a requirement where I need to pull the application code from <code>Github</code> when <code>autoscaling</code> happens. As the code changes frequently, we can't take an <code>AMI</code> and launch an instance from that <code>AMI</code>. So I want to pull the latest code from <code>repositories</code>. AWS just launched a service called <code>AWS CodeDeploy</code>. <strong>How can I use this service to automate the process of pulling the code when the instances start?</strong></p>
  
  <p>P.S. I have written an <code>init script</code> to automatically attach an <code>EIP</code>, whitelist that IP on different Security Groups and put the instance under a <code>load-balancer</code> when the instance boots and revoking everything when instance is terminated in autoscaling.</p>