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.
101
questions
0
votes
0
answers
29
views
What could be causing my Ruby application to only download a 1 KB file when trying to get a video from a private S3 bucket?
We have an S3 private bucket, and the objects within it are also private. We only upload PDF and MP4 files.
I am able to download the PDF files from a Ruby application. However, when I try to download ...
1
vote
0
answers
254
views
AWS-SDK-SES: How Can I Check the Existence of an Email Address in Rails?
I currently have Rails applications that use SES to send emails. Unfortunately no matter how much code I put in my application I still get emails with invalid email addresses.
I want to use AWS to ...
0
votes
1
answer
143
views
Ignore AWS ruby SDK global config
I'm working with the AWS ruby SDK and trying to override the global config for a specific client.
When I load the application I set the global config for S3 use like this
Aws.config.update(
endpoint:...
0
votes
2
answers
1k
views
Sending sms using AWS sns outside sandbox, still need to verify the new phone number first?
I keep looking for the informaion on AWS SNS services of SMS.
I would like to make sure the question before I request AWS account being moved out of the SMS sandbox.
I am trying to use this services ...
0
votes
3
answers
604
views
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 ...
4
votes
0
answers
893
views
"Tried to create Proc object without a block" error when running AWS SDK with ruby 3.1
I'm getting the error "tried to create Proc object without a block (ArgumentError)" from the AWS SDK Core gem when trying to run a rails app after upgrading ruby to 3.1.1. This surprises me ...
0
votes
1
answer
120
views
Use AWS sdk ruby with custom AWS endpoints.json
I am deploying some services on a different cloud than the AWS cloud, but that exposes AWS compatible endpoints.
I was given an endpoints.json file that looks like this
{
"partitions": [
...
5
votes
2
answers
397
views
Rails 6 - Allow/Disallow file download as per user role for files on AWS S3
I have a Rails 6 app, where registered users(Owner) can upload files - images/videos on S3 and then the the owner can provide access to other users(invitations) to view their uploaded content.
Is ...
0
votes
2
answers
114
views
How can I print double quotes in ruby
Am trying to bring output like below in AWS console for Cloudwatch metric filter pattern
[w1,w2,w3,w4=!"*10.1.1.1*"&&w5=!"*10.1.1.2*"&&w5="*admin*"]
for ...
-2
votes
1
answer
72
views
Converting output of one function into array and feed value into variable in other function in ruby
For one of ruby programming logic, am trying to convert the string output of one function into an array and from array have to feed the values to the variables declared in other function of the ...
1
vote
2
answers
922
views
How can I update a lifecycle configuration with a filter based on both prefix and multiple tags in Ruby?
I want to put a lifecycle_configuration to an S3 bucket with a rule that uses a filter with multiple tags and a prefix.
I can successfully put_lifecycle_configuration if the filter uses only one tag ...
0
votes
1
answer
20
views
ruby-aws-sdk record persists after delete
I'm trying to delete object from aws s3 via key
key = "vocs_direct%25252F2021-09-14%25252Fd4c494cc-48a5-4fbd-b6ea-712a8d0b8c55.mp3"
AWS_S3_BUCKET.object(key).delete
and I get a succesful ...
2
votes
3
answers
3k
views
aws-sdk-core/xml/parser.rb:74:in `set_default_engine': Unable to find a compatible xml library), Ruby version 3.0.2
I am having a legacy ruby daemon script that runs on a linux server. On upgrading all ruby and gem package versions with in the instance, the daemon script is now erroring out. Same error I am getting ...
0
votes
0
answers
178
views
aws ruby sdk - read a pretty large file from S3
I am trying to read around 1.5GB size from s3 using ruby sdk for aws.
S3 gem is - gem 'aws-sdk' ( https://github.com/aws/aws-sdk-ruby )
most_recent_s3_object = s3_resource.bucket(bucket_name).objects....
0
votes
1
answer
4k
views
Aws::S3::Errors::InvalidAccessKeyId (The AWS Access Key Id you provided does not exist in our records.)
On a Rails 6 app I use aws-sdk-s3 with ActiveStorage and I want to upload images.
Steps:
I created a IAM User on AWS with S3FullAccess
I configured storage.yml (see below)
I created an config/aws.rb ...
0
votes
1
answer
278
views
Erroneous Aws::ECS::Errors::ClusterNotFoundException — what is happening?
I have an ECS cluster, an active service for it, and a task for this service. I am trying to call ListTasks with Ruby AWS SDK.
When there is no active task, it comes through with an empty list, as ...
1
vote
1
answer
3k
views
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 ...
5
votes
1
answer
844
views
Using AWS Glue Schema Registry for Node.js or Ruby on Rails
Looking at the documentation for AWS Glue Schema Registry it seems like you can't use it for Node.js or Ruby on Rails:
The AWS Glue Schema Registry supports AVRO (v1.10.2) data format and
Java ...
0
votes
1
answer
375
views
Add tag using s3.put_object
I am using aws-sdk-core v2.2.37 as I cannot upgrade for various reasons.
Despite the documentation clearly showing that I can add a tag to the object with the "tagging" key.
https://docs.aws....
2
votes
0
answers
575
views
Ruby on Rails - AWS Signature Version 4
I have a Ruby on Rails app and I am currently getting this message. What's the best way to go about resolving this issue?
Ruby 2.5.8
Rails 5.2
Following AWS Gems are available:
* aws-eventstream (1....
1
vote
0
answers
153
views
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 ...
0
votes
1
answer
155
views
AWS Ruby SDK Cloudformation will not validate a template
running into a ruby Cloudformation problem I have a super simple cloudformation template is will validate and create_stack with AWS CLI, but failing when I run either of the same commands with the the ...
0
votes
1
answer
111
views
SES SDK Rails6 not picking up Region
Update:
I turned on
config.action_mailer.raise_delivery_errors = true
Which resulted in reported error about the region being used - which is not the one I configured.
The following identities ...
0
votes
1
answer
858
views
How do I use the results of an SSM port forwarding session started with ruby?
I'm having trouble reconciling the differences between using the aws cli and the ruby sdk to make ssm connections to an instance. For example, if I try using the command like like this:
aws ssm start-...
1
vote
1
answer
170
views
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 ...
0
votes
1
answer
2k
views
How to upload an object using presigned URL along with tags in s3 aws-sdk-ruby v3
I am trying to upload an object using a presigned URL. But I want to upload the the object along with tags. What is the proper way to do it?
Approach 1:
I tried the following ruby code:
signer = Aws::...
2
votes
0
answers
511
views
How determine level error of aws s3 sdk errors?
Question
I'm trying to determine wether an error returned by the AWS ruby SDK is a server error or a client error.
Using gem 'aws-sdk-s3', '~> 1'.
Looking at the documentation: https://docs.aws....
0
votes
1
answer
105
views
Rails ActiveJob can't load aws-sdk-transcribeservice
In my Rails application, I need to use AWS Transcribe service. But, when I tried to create the AWS client from inside ActiveJob, the Sidekiq log always gives me NameError: uninitialized constant Aws::...
9
votes
2
answers
2k
views
Ruby: S3 access with AWS instance profile
I have a ec2 instance which has a profile attached. I can use awscli and it uploads to the bucket fine.
root@ocr-sa-test:/# aws s3 ls s3://company-ocr-east/
PRE 7_day_expiry/...
1
vote
0
answers
76
views
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 ...
1
vote
0
answers
39
views
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, ...
0
votes
2
answers
2k
views
How do I fix this error NameError: uninitialized constant AWS
So I got this error: NameError: uninitialized constant which StackOverflow says means that it is unintentionally upgrading, but that cannot be, because my version is the highest, I have in the gem ...
2
votes
0
answers
227
views
AWS EC2 Instance Profile for S3 permissions inconsistent
Background: I'm writing an automated deployment script to deploy a ruby on rails application to AWS on an EC2 instance using S3 as the storage for ActiveStorage. My script creates an instance profile/...
3
votes
2
answers
3k
views
Rails keeps asking for AWS credentials for MySQL storage
I’m trying out Sharetribe Community Edition on a Debian 10 server (not AWS) following these instructions: https://github.com/sharetribe/sharetribe#installation
I am stuck on step 7 with the following ...
1
vote
1
answer
313
views
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],
...
1
vote
0
answers
69
views
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.
0
votes
1
answer
536
views
Aws SDK Ruby - retrieve credentials automatically when configuring Faraday
I enjoy using the AWS SDK without having to specify where to find the credentials, it makes it easier to configure on multiple environment where different types of credentials are available.
The ...
1
vote
0
answers
2k
views
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 ...
3
votes
1
answer
899
views
Getting the event body attributes in Ruby with AWS Lambda
So I'm new to ruby and I have a simple REST API.
The post request looks like this:
POST /endpoint, { 'message': 1 }
My lambda handler looks like this:
def run(event:, context:)
puts "#{event['...
1
vote
1
answer
428
views
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-...
0
votes
1
answer
198
views
How to get AWS access key and secret key using aws-sdk-ruby --aws-sdk-iam,aws-sdk-core
I'm a newbie to aws and ruby. I'm trying to get access key and the secret key using the aws-sdk-ruby, as due to security reasons we do not have access to keys in the AWS Console. I tried to use the '...
0
votes
2
answers
329
views
Can't start rails server after aws-sdk-3 installed
I know that there is a lot of such kind of questions, but still, I believe my case is slightly different.
I recently decided to build in an AWS-S3 gem to my rails version 3 project (RUBY_VERSION - 1....
0
votes
1
answer
2k
views
Stub response for AWS S3 Ruby SDK
I'm looking for a way to test my code that relies on AWS S3. I found the Advanced Client Stubbing tutorial but I was only able to find the correct way to stub list_objects from the Aws::S3::Client ...
0
votes
1
answer
43
views
Ruby AWS-SDK: How to list the parent checks of a health check
I have a job that cleans out unused health checks. Some of them cant be deleted if they have a parent check resulting in the error:
Invalid parameter : Health check SOMEHEALTHCHECKID is still ...
1
vote
1
answer
891
views
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 ...
0
votes
1
answer
954
views
How do you set a Content-Type Header for the Ruby AWS SDK?
I'm using Webmock to test http requests made by the ruby aws-sdk (in this case aws-sdk-batch).
Webmock handles json requests with a much more convenient hash diff and partial matching when the ...
0
votes
1
answer
28
views
Dumping Cognito users to JSON using Ruby causes the results to be [FILTERED]
I'm trying to backup Cognito users using the AWS Ruby SDK. Everything is going well except when I call to_json on any users attributes, it outputs every value as "[FILTERED]". If I use to_yaml ...
0
votes
1
answer
2k
views
S3 Upload/Download Timeout Issues
I'm attempting to create a kmz format file of geotagged images, using S3 file storage and sdk access through a ruby-on-rails app on Heroku.
I'm running the file processes when the "project" view ...
0
votes
1
answer
218
views
aws-sdk-ruby v3 not giving the iam policy in proper json format
I want to retrieve the policy document associated with the iam role and policy using aws-sdk and ruby. Using aws cli, I am getting the proper output but using aws sdk and ruby getting encrypted json ...
-1
votes
2
answers
271
views
Aws CostExplorer Api giving exception using ruby sdk
I found this reference https://docs.aws.amazon.com/sdkforruby/api/Aws/CostExplorer/Client.html#initialize-instance_method for finding cost of ec2 instance usages ,while in implementing phase i got ...