Giter Site home page Giter Site logo

alifjamaluddin / aws-sdk-rails Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aws/aws-sdk-rails

0.0 2.0 0.0 17 KB

Official repository for the aws-sdk-rails gem, which integrates the AWS SDK for Ruby V2 with Ruby on Rails.

License: Other

Ruby 100.00%

aws-sdk-rails's Introduction

AWS SDK for Ruby Rails Plugin

Build Status Code Climate

A Ruby on Rails plugin that integrates AWS services with your Rails application using the AWS SDK for Ruby Version 2.

Usage

Simply require this in your Rails project's Gemfile, and AWS SDK features will be added to your Rails environment:

gem 'aws-sdk-rails'

This dependency will automatically pull in version 2 of the AWS SDK for Ruby.

You will have to ensure that you provide credentials for the SDK to use. See the AWS SDK for Ruby V2 Docs for details. If you need to provide your own credentials, you can call client-creating actions manually. For example, to provide your own credentials for using Amazon Simple Email Service as a delivery method for ActionMailer:

RAILS_ROOT/secrets.json

{
	"AccessKeyId":"your-access-key-id",
	"SecretAccessKey":"your-secret-access-key"
}

RAILS_ROOT/config/initializers/aws-sdk.rb

require 'json'
# Because you're never going to commit credentials to source. Please add it in .gitignore.
creds = JSON.load(File.read('secrets.json'))
creds = Aws::Credentials.new(creds['AccessKeyId'], creds['SecretAccessKey'])
Aws::Rails.add_action_mailer_delivery_method(:aws_sdk, credentials: creds, region: 'us-east-1')

If you're running your Ruby on Rails application on Amazon Elastic Compute Cloud, keep in mind that the AWS SDK for Ruby will automatically check Amazon EC2 instance metadata for credentials. Learn more: IAM Roles for Amazon EC2

AWS SDK for Ruby Logging Uses the Rails Logger

Automatically, the AWS SDK for Ruby will be configured to use the built-in Rails logger for any SDK log output.

Using Amazon SES as an ActionMailer Delivery Method

The gem will set this up automatically, with an example of doing this manually above. With the delivery method in place, you simply need to configure Rails to use SES as a delivery method in your environment configuration:

# for e.g.: RAILS_ROOT/config/environments/production.rb
config.action_mailer.delivery_method = :aws_sdk

With this in place, the AWS SDK's SES client will be used by ActionMailer.

aws-sdk-rails's People

Contributors

alifjamaluddin avatar amw avatar awood45 avatar chiastolite avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.