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:
sudo -u ec2-user git clone https://github.com/...git
I have 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 'https://github.com/...git/': Could not resolve host: github.com; Name or service not known"
Any suggestions as to how I can run this as ec2-user?