AWS SDK for Ruby
Developer Guide

Using the SDK with Ruby on Rails

Ruby on Rails provides a web development framework for Ruby that makes it easy to create websites with Ruby.

The AWS SDK for Ruby provides a gem to enable easy integration with Rails. You can use AWS Elastic Beanstalk, AWS OpsWorks, or AWS CodeDeploy to deploy and run your Rails applications in the AWS Cloud.

Integrating the AWS SDK for Ruby with Rails

AWS provides a gemfile, aws-sdk-rails, that supports integration of the AWS SDK for Ruby with Rails. You can view its GitHub repository at https://github.com/aws/aws-sdk-rails.

Add the gem to your application's Gemfile, as shown in the following example.

gem 'aws-sdk-rails'

The gem includes the AWS SDK for Ruby, so adding the gem is all you need to do to add AWS support to your Rails application.

Amazon SES Support for ActionMailer

When you use the aws-sdk-rails gem in a config/environments file of your Rails project (for example, config/environments/production.rb), you can use Amazon Simple Email Service (Amazon SES) as the back end for the ActionMailer class, as shown in the following example.

config.action_mailer.delivery_method = :aws_sdk

For more information about ActionMailer, see the Action Mailer Basics on the Ruby on Rails website.

Logging

The aws-sdk-rails gem configures the SDK logger to use Rails.logger.

The gem also configures the SDK log messages to use the :info log level. You can change the log level by setting :log_level in the Aws.config hash. The following example sets the log level to :debug.

Aws.config.update({log_level: :debug})