I’ve used the various amazon cloud stuff a bit but don’t totally
understand it …
I have a test program below that prints out files and directories I have
on
the cloud which has worked fine for me.
When I go to the amazon console, I have to log in using an email
address,
then it shows me my buckets on the cloud.
A guy I started working for at a company emailed me my user name, ID,
and
secret access key for their cloud stuff … Using my program I can see
the
stuff on the cloud but how can I log into it from the amazon web based
console ? Since he did not send me an email or password but only a user
name, ID and secret access key … I am not sure how I can log in through
amazon to look at it ?
require ‘rubygems’
require ‘fog’
AWS_ACCESS_KEY_ID = “**********"
AWS_SECRET_ACCESS_KEY = "”
create a connection
@con = Fog::Storage.new({
:provider => ‘AWS’,
:aws_access_key_id => AWS_ACCESS_KEY_ID,
:aws_secret_access_key => AWS_SECRET_ACCESS_KEY
})
cnt = 0
@con.directories.each do|dir|
puts ‘-------------’
puts dir.inspect
puts “\n\n”
puts dir.files.inspect
cnt += 1
sleep 2
puts cnt.to_s
exit if cnt > 25
end