title: Can't git clone as ec2-user in userdata section
body: <p>I have an autoscaling group set up in my cloudformation template that spins up a single ec2 instance. In my userdata section of launchconfiguration, I execute the following statement:</p>
  
  <pre><code>sudo -u ec2-user git clone https://github.com/...git
  </code></pre>
  
  <p>I <strong>have</strong> to run this as an ec2-user, not as root. In the cloud-init-output.log, I get the following error:
  "fatal: unable to access '<a href="https://github.com/...git/" rel="nofollow noreferrer">https://github.com/...git/</a>': Could not resolve host: github.com; Name or service not known"</p>
  
  <p>Any suggestions as to how I can run this as ec2-user?</p>