Quantcast
Channel: rails – The Agile Warrior
Viewing all articles
Browse latest Browse all 48

How to setup and amazon webservices and connect to from Rails

$
0
0

Some notes for future me the next time I need to do this again.

Create amazon webservice account

Goto management console

https://console.aws.amazon.com/console/home?sc_icampaign=welcome_email_2&sc_ichannel=EM&sc_icontent=console_link&sc_idetail=intro_paragraph&sc_iplace=welcome_email_2#

Click on S3 for storage.

s3

Create a new bucket

create-a-new-bucket

Create any directories you want

Upload your resource

upload-resource

Upload resource into your bucket
https://console.aws.amazon.com/s3/home?region=us-west-2

Set content-type to audio/mpeg for video

set-content-type-video

If you try connecting to the link you just created

aws-resource-link

you will get an unauthorized error. That’s because unless open to everyone, only authorized users will be able to see.

access-denied

To see what your authorized access link would look like, right click on your resource and select open.

open-resource

That URL you see at the top of the new window (containing access AWSAccessKeyId) is what you’ll need to build as a link, so your users can click and watch your video.

https://s3.amazonaws.com/agilenutshell/video/Project+Status+Reports.mp4?AWSAccessKeyId=XXX

You need to build this link above, inserting your aws credentials.

So created your credentials, then build the link in rails (gist below).

Create security credentials

https://console.aws.amazon.com/iam/home#security_credential

https://portal.aws.amazon.com/gp/aws/securityCredentials (old)

Build link

https://gist.github.com/iwasrobbed/1032395


Filed under: programming, rails Tagged: amazons3, aws, rails

Viewing all articles
Browse latest Browse all 48

Trending Articles