|« PreviousNext »|
|Did this page help you? Yes | No | Tell us about it...|
The following tasks guide you through using the AWS SDK for Ruby to send authenticated requests using your AWS Account credentials or IAM user credentials.
Making Requests Using Your AWS Account or IAM user Credentials
Create an instance of the
Make a request to Amazon S3 by enumerating objects in a bucket using the
The following Ruby code sample demonstrates the preceding tasks.
# Get an instance of the S3 interface using the specified credentials configuration. s3 = AWS::S3.new( :access_key_id => my_access_key_id, :secret_access_key => my_secret_key) # Get a list of all object keys in a bucket. bucket = s3.buckets[bucket_name].objects.collect(&:key) puts bucket
You can create the
AWS:S3 client without providing your security
credentials. Requests sent using this client are anonymous requests, without a
signature. Amazon S3 returns an error if you send anonymous requests for a resource
that is not publicly available.