Questions tagged [aws-sdk-ruby]

The official AWS SDK for Ruby is a gem used to access many AWS services such as S3, EC2, DynamoDB, Glacier, SQS, SimpleDB, Elastic Beanstalk and more.

The AWS SDK for Ruby is an official gem provided to facilitate interactions with numerous AWS services. For version 3, services have been modularized into individual gems that can be imported, such as aws-sdk-s3 or aws-sdk-ec2. Alternatively, the aws-sdk gem will import every available service gem.

This tag can be used for questions regarding either the general aws-sdk gem, or any of its supported services gems.

Resources:

101 questions
1
vote
1 answer

How to configure ephemeral storage on ECS Fargate Task via Ruby SDK?

I'm using the Ruby SDK for AWS ECS to kick-off a task hosted in Fargate via run_task method. This all works fine with the defaults — I can kick off the task OK and can send along custom command parameters to my Docker container: client =…
anotherdave
  • 6,656
  • 4
  • 34
  • 65
1
vote
0 answers

How to omit "Aws :: ECSCredentials.new" in ruby

Currently, the way to write the source differs depending on the execution environment and I want to fix it to a unified writing style. The code is as follows depending on the environment. When connecting to s3 with ECS: client =…
negabaro
  • 3,127
  • 7
  • 21
  • 33
1
vote
1 answer

Why can't I find any documentation on Aws::SQS::Errors::NonExistentQueue

SQS client raises Aws::SQS::Errors::NonExistentQueue error when queue is not found. But, why https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/SQS/Errors.html This doc doesn't mention a thing about it. However, I found it here…
Mike
  • 725
  • 2
  • 11
  • 21
1
vote
0 answers

How to config a instance using run_instance of aws-sdk-ec2/client.rb?

I hope you are all well. I want to create an instance for a cluster using ruby. First, I created the client: client = Aws::ECS::Client.new(Client.params) After that, I tried to prepare a variable for the user_data field: user_data = message =…
Pedro Paiva
  • 721
  • 11
  • 17
1
vote
0 answers

Add cache_control to images with Ruby aws-sdk

I'm trying to add cache_control to images within s3 buckets via a Ruby script, yet I keep running into an Access Denied (Aws::S3::Errors::AccessDenied) error. All my environment variables are correct, and I'm having no issue creating new buckets…
jstamos
  • 55
  • 5
1
vote
1 answer

Ruby : Invocation does not exist

Im working with the aws sdk and want to use the get_command_invocation method. This is what I have in accordance with the docs: resp = client.send_command( instance_ids: [instance_id], document_name: 'AWS-RunShellScript', …
letsc
  • 2,515
  • 5
  • 35
  • 54
1
vote
0 answers

Is there a way to cache KMS data keys using the Ruby AWS sdk?

I am using the Ruby AWS SDK with Rails. Does the SDK provide a way to cache KMS data keys? I'd like to lessen the requests to KMS to improve app performance.
Hokiedood
  • 123
  • 2
  • 5
1
vote
0 answers

S3 bucket object is uploading duplicate files

I am having a terrible time trying to figure out why duplicate files are being uploaded. Here's what's happening: We upload photos of varying size (i.e. 75 width, 300 width, 1920 width, etc). The upload succeeds and I can see in the logging that no…
Drew P
  • 63
  • 5
1
vote
1 answer

Searchkick AWS Credentials Expire

I've set up by elasticsearch.rb initializer with the following aws_credentials. Searchkick.aws_credentials = { credentials: Aws::InstanceProfileCredentials.new.credentials, region: 'us-west-2', } This works fine when I first redeploy…
1
vote
1 answer

Getting a MalformedQueryString exception when creating an SQS standard queue

I am trying to create an AWS SQS standard queue locally with localstack and using ruby's aws-sdk-sqs library. I am running into an error when passing in parameters into the RedrivePolicy attribute. I believe I am using the API documentation…
1
vote
1 answer

Do I have to download an image before upload it to s3?

I have Rails app with embedded images. What I want is to upload these images to s3 and serve theme from there instead of form original source Do I have to download the img to my server before upload it to s3?
MIA
  • 373
  • 3
  • 18
1
vote
2 answers

Why does ruby aws-sdk uploading to S3 take over 40 seconds for small file sizes

I've been dealing with very slow upload speeds from my application to S3. I have a rails application running in a single docker environment on Elastic Beanstalk and a specific bucket that stores files created by the user. Both are in the same region…
Matt Grannary
  • 363
  • 2
  • 7
1
vote
0 answers

Ruby bundle console is not loading aws shared credentials from ~/.aws/credentials

How can I load aws credentials to ruby if I use bundler console. Scenario: I have the following code in samplefile.rb and aws credentials in ~/.aws/credentials require 'aws-sdk-core' require 'aws-sdk-s3' require 'json' class Publisher def…
1
vote
1 answer

browser caching shrine s3 private attachments

I have just created a private bucket on s3, to contain user profile pictures. With a public bucket, all of the images are properly cached (previous paperclip config with same settings). I have the following shrine initializer: s3_options = { …
user1213904
  • 1,830
  • 4
  • 23
  • 39
1
vote
3 answers

Rails Active storage Unable to autoload constant ActiveStorage::Blob::Analyzable

I've updated rails from 5.1.4 to 5.2 and remove Papaerclip to use Active Storage. I'm using digitalocean spaces. In my development env I've setted credentials in storage.yml to save images to digitalocean. I've added aws-sdk-s3 gem in gemfile…
Bistaff
  • 133
  • 2
  • 12