How to move files from an S3 bucket to EC2 when creating an instance

I am creating Flash Media servers using the AMI that Adobe provides. I need to upload some config.xml files to specific server directories so that when I start FMS, it will have the security configurations that I want and several other things that I want to do.

I have a basic understanding that you can pass user data as a bash file to an instance. Would this be the best option?

Can someone provide me with a good example of what the bash file would look like if I wanted to copy the xml file from S3 to DIR on an FMS / CentOS instance?

+3
source share
1 answer

, , , . , , .

: AMI , /. , S3, sortof .

script AWS, unix wget curl.

#!/bin/bash
cd /some/destination/path/
curl -v --header 'Date: Fri, 27 May 2011 14:17:00 -0500' \
        --header 'Authorization: AWS AWSAccessKeyId:Signature' \
        "https://s3.amazonaws.com/your-s3-bucket/path/to/file.xml"

, , .

s3- bash, ..

+2

All Articles