I need to be able to copy some files from s3 bucket into ec2 instance during launch time . Is it possible to do so via user data section of the cloudformation template?
Fyi, I have the role attached to the instance to access s3 and I am able to copy files using aws cli but I need to be able to do so via user data inside cloudformation without using aws cli, if possible at all.
Edit--
Object in s3 is publicly accessible at the moment and the instance is using a custom red hat ami.