Thursday, January 2, 2014

[Rails] access EC2 from web console without email ?


 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


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/e17ab879-a318-4924-a1e2-abad6005752e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate