Akshay Gopani
Akshay Gopani

Reputation: 491

List objects from publicly accessible Amazon S3 bucket

I have one Amazon S3 bucket which is public with list and get permission. I want to list object in ruby. We can use AWS SDK to list objects but it require credentials. I want to list objects in ruby without using credentials. how to achieve this ??

Upvotes: 0

Views: 984

Answers (3)

jarmod
jarmod

Reputation: 78850

Not all AWS SDKs expose options to make unsigned API requests. There is no option in the Ruby SDK.

You might want to comment on, or re-open, this previously-closed feature request in the Ruby SDK.

Upvotes: 0

smac2020
smac2020

Reputation: 10734

To use AWS SDK in any language, you need to create a Service Client in that given language, Ruby is no different from .NET, Python, Java, etc.

To make an AWS Service call from a Service Client (not CLI, or Rest, etc), you must specify creds. More information can be found in the AWS Ruby DEV Guide:

Configuring the AWS SDK for Ruby

Upvotes: 0

Charles Lu
Charles Lu

Reputation: 1

I think you could use the HTTP Method.Amazon S3 support make requests to Amazon S3 endpoints by using the REST API. I try putObject with HTTP Method and it work,I use the curl command. But the Object owner is anonymous, i can't remove it. And I am not familiar with Ruby,I think it also work with listObject without use SDK.

This is my curl command : curl --request PUT --upload-file "./myobject" "https://${mybkt}......../myobject"

ListObject HTTP method Doc: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html

Upvotes: 0

Related Questions