I need to be able to copy a tar file from a s3 bucket and untar when I launch my EC2 instances. I basically have this simple user_data:
#/bin/bash
aws s3 cp s3://my-bucket/mytarfile.tar mytarfile.tar > /tmp/output 2>&1
After my instance launches there is no mytarfile.tar anywhere on the instance and the /tmp/output contains the error message:
fatal error: Unable to locate credentials
So I guess it is impossible to use the aws command line in EC2 user_data.