Search code examples
ruby-on-railsrubyamazon-s3shrine

Does Shrine Storage S3 supports options for IAM Profiles?


His there an option that can be sent as an argument of Shrine::Storage::S3.new that sets the use of an IAM Profile to true, just like Carrierwave does?

For example:

s3_options = {
  use_iam_profile: true,
}

Shrine::Storage::S3.new(
  upload_options: { server_side_encryption: "AES256" },
  **s3_options,
)

Solution

  • Shrine's S3 storage supports any configuration that Aws::S3::Client#initialize supports. If I remember correctly, in order to use the IAM profile, you should simply not pass any credentials (and specify only the bucket name).

    Shrine::Storage::S3.new(
      bucket: "your-bucket-name",
      upload_options: { ... },
    )