{"id":13879197,"url":"https://github.com/aws/aws-sdk-rails","last_synced_at":"2025-04-29T14:38:18.492Z","repository":{"id":28885284,"uuid":"32409894","full_name":"aws/aws-sdk-rails","owner":"aws","description":"Official repository for the aws-sdk-rails gem, which integrates the AWS SDK for Ruby with Ruby on Rails.","archived":false,"fork":false,"pushed_at":"2024-12-05T16:40:19.000Z","size":585,"stargazers_count":610,"open_issues_count":2,"forks_count":63,"subscribers_count":41,"default_branch":"main","last_synced_at":"2025-04-20T10:22:40.430Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aws.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-03-17T17:42:55.000Z","updated_at":"2025-04-13T15:49:25.000Z","dependencies_parsed_at":"2023-02-13T23:15:27.725Z","dependency_job_id":"f69ef51b-745b-41b2-abcc-686ad5ce81b3","html_url":"https://github.com/aws/aws-sdk-rails","commit_stats":{"total_commits":255,"total_committers":31,"mean_commits":8.225806451612904,"dds":0.6627450980392157,"last_synced_commit":"eed32d55aaf3d3c351fb572fbb83d329e2e5dfb4"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws%2Faws-sdk-rails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws%2Faws-sdk-rails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws%2Faws-sdk-rails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws%2Faws-sdk-rails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aws","download_url":"https://codeload.github.com/aws/aws-sdk-rails/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251520228,"owners_count":21602453,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-06T08:02:13.135Z","updated_at":"2025-04-29T14:38:18.471Z","avatar_url":"https://github.com/aws.png","language":"Ruby","funding_links":[],"categories":["Ruby","SDKs and Samples"],"sub_categories":["Ruby SDK"],"readme":"# AWS SDK for Ruby Rails Plugin\n\n[![Gem Version](https://badge.fury.io/rb/aws-sdk-rails.svg)](https://badge.fury.io/rb/aws-sdk-rails)\n[![Build Status](https://github.com/aws/aws-sdk-rails/workflows/CI/badge.svg)](https://github.com/aws/aws-sdk-rails/actions)\n[![Github forks](https://img.shields.io/github/forks/aws/aws-sdk-rails.svg)](https://github.com/aws/aws-sdk-rails/network)\n[![Github stars](https://img.shields.io/github/stars/aws/aws-sdk-rails.svg)](https://github.com/aws/aws-sdk-rails/stargazers)\n\nA Ruby on Rails plugin that integrates AWS services with your application using\nthe latest version of [AWS SDK For Ruby](https://github.com/aws/aws-sdk-ruby).\n\n## Installation\n\nAdd this gem to your Rails project's Gemfile:\n\n```ruby\ngem 'aws-sdk-rails', '~\u003e 5'\n```\n\nThis gem also brings in the following AWS gems:\n\n* `aws-sdk-core`\n\nYou will have to ensure that you provide credentials for the SDK to use. See the\nlatest [AWS SDK for Ruby Docs](https://docs.aws.amazon.com/sdk-for-ruby/v3/api/index.html#Configuration)\nfor details.\n\nIf you're running your Rails application on Amazon EC2, the AWS SDK will\ncheck Amazon EC2 instance metadata for credentials to load. Learn more:\n[IAM Roles for Amazon EC2](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html)\n\n# Features\n\n## ActionDispatch DynamoDB Session Storage\n\nSee https://github.com/aws/aws-actiondispatch-dynamodb-ruby\n\n## ActionMailer delivery with Amazon Simple Email Service\n\nSee https://github.com/aws/aws-actionmailer-ses-ruby\n\n## ActionMailbox ingress with Amazon Simple Email Service\n\nSee https://github.com/aws/aws-actionmailbox-ses-ruby\n\n## ActiveJob SQS adapter\n\nSee https://github.com/aws/aws-activejob-sqs-ruby\n\n## AWS Record Generators\n\nSee https://github.com/aws/aws-record-rails\n\n## AWS SDK uses the Rails logger\n\nThe AWS SDK is configured to use the built-in Rails logger for any\nSDK log output. The logger is configured to use the `:info` log level. You can\nchange the log level by setting `:log_level` in the\n[Aws.config](https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws.html) hash.\n\n```ruby\nAws.config.update(log_level: :debug)\n```\n\n## Rails 5.2+ Encrypted Credentials\n\nIf you are using [Encrypted Credentials](http://guides.rubyonrails.org/security.html#custom-credentials),\nthe credentials will be decrypted and loaded under the `:aws` top level key:\n\n```yml\n# config/credentials.yml.enc\n# viewable with: `bundle exec rails credentials:edit`\naws:\n  access_key_id: YOUR_KEY_ID\n  secret_access_key: YOUR_ACCESS_KEY\n  session_token: YOUR_SESSION_TOKEN\n  account_id: YOUR_ACCOUNT_ID\n```\n\nEncrypted Credentials will take precedence over any other AWS Credentials that\nmay exist in your environment (e.g. credentials from profiles set in `~/.aws/credentials`).\n\nIf you are using [ActiveStorage](https://edgeguides.rubyonrails.org/active_storage_overview.html)\nwith `S3`, then you do not need to specify your credentials in your `storage.yml`\nconfiguration because they will be loaded automatically.\n\n## AWS SDK eager loading\n\nAn initializer will eager load the AWS SDK for you. To enable eager loading,\nadd the following to your `config/application.rb`:\n\n```ruby\nconfig.eager_load = true\n```\n\n## ActiveSupport Notifications for AWS SDK calls\n\n[ActiveSupport::Notifications](https://api.rubyonrails.org/classes/ActiveSupport/Notifications.html)\ninstrumentation is enabled by default for all AWS SDK calls. Events are\npublished for each client operation call with the following event name:\n`\u003coperation\u003e.\u003cserviceId\u003e.aws`. For example, S3's `:put_object` has an event name\nof: `put_object.S3.aws`. The service name will always match the namespace of the\nservice client (e.g. Aws::S3::Client =\u003e 'S3'). The payload of the event is the\n[request context](https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Seahorse/Client/RequestContext.html).\n\nYou can subscribe to these events as you would for other\n`ActiveSupport::Notifications`:\n\n ```ruby\nActiveSupport::Notifications.subscribe('put_object.S3.aws') do |name, start, finish, id, payload|\n  # process event\nend\n\n# Or use a regex to subscribe to all service notifications\nActiveSupport::Notifications.subscribe(/S3[.]aws/) do |name, start, finish, id, payload|\n  # process event\nend\n```\n\n### Elastic Beanstalk ActiveJob processing\n\n[Elastic Beanstalk worker environments](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features-managing-env-tiers.html)\ncan be used to run ActiveJob without managing a worker process. To do this,\n[configure the worker](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features-managing-env-tiers.html#using-features-managing-env-tiers-worker-settings)\nto read from the correct SQS queue that you want to process jobs from and set\nthe `AWS_PROCESS_BEANSTALK_WORKER_REQUESTS` environment variable to `true` in\nthe worker environment configuration. The\n[SQS Daemon](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features-managing-env-tiers.html#worker-daemon)\nrunning on the worker sends messages as a POST request to `http://localhost/`.\nThe ElasticBeanstalkSQSD middleware will forward each request and parameters to their\nappropriate jobs. The middleware will only process requests from the SQS daemon\nand will pass on others and so will not interfere with other routes in your\napplication.\n\nTo protect against forgeries, daemon requests will only be processed if they\noriginate from localhost or the Docker host.\n\n#### Running Jobs Async\nBy default the ElasticBeanstalkSQSD middleware will process jobs synchronously\nand will not complete the request until the job has finished executing.  For\nlong running jobs (exceeding the configured nginix timeout on the worker) this\nmay cause timeouts and incomplete executions.  \n\nTo run jobs asynchronously, set the `AWS_PROCESS_BEANSTALK_WORKER_JOBS_ASYNC`\nenvironment variable to `true` in your worker environment.  Jobs will be queued\nin a ThreadPoolExecutor and the request will return a 200 OK immediately and the\nSQS message will be deleted and the job will be executed in the background.\n\nBy default the executor will use the available processor count as the the\nmax_threads.  You can configure the max threads for the executor by setting\nthe `AWS_PROCESS_BEANSTALK_WORKER_THREADS` environment variable.\n\nWhen there is no additional capacity to execute a task, the middleware\nreturns a 429 (too many requests) response which will result in the \nsqsd NOT deleting the message.  The message will be retried again once its\nvisibility timeout is reached.\n\nPeriodic (scheduled) tasks will also be run asynchronously in the same way.\nElastic beanstalk queues a message for the periodic task and if there is\nno capacity to execute the task, it will be retried again once the message's\nvisibility timeout is reached.\n\n#### Periodic (scheduled) jobs\n[Periodic (scheduled) tasks](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features-managing-env-tiers.html#worker-periodictasks)\nare also supported with this approach. Elastic\nBeanstalk workers support the addition of a `cron.yaml` file in the application\nroot to configure this. You can call your jobs from your controller actions\nor if you name your cron job the same as your job class and set the URL to\n`/`, the middleware will automatically call the job.\n\nExample:\n```yml\nversion: 1\ncron:\n - name: \"do some task\"\n   url: \"/scheduled\"\n   schedule: \"0 */12 * * *\"\n - name: \"SomeJob\"\n   url: \"/\"\n   schedule: \"* * * * *\"\n```\n\nand in your controller:\n\n```ruby\nclass SomeController \u003c ApplicationController\n  def scheduled\n    SomeJob.perform_later\n  end\nend\n```\n\nWill execute cron `SomeJob` every minute and `SomeJob` every 12 hours via the\n`/scheduled` endpoint.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faws%2Faws-sdk-rails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faws%2Faws-sdk-rails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faws%2Faws-sdk-rails/lists"}