module Aws::Rails
def self.add_action_mailer_delivery_method(name = :ses, options = {})
-
options
(Hash
) -- The options you wish to pass on to the -
name
(Symbol
) -- The name of the ActionMailer delivery method to
def self.add_action_mailer_delivery_method(name = :ses, options = {}) ActiveSupport.on_load(:action_mailer) do add_delivery_method(name, Aws::Rails::Mailer, options) end end
def self.add_sqsd_middleware(app)
This will only be added in the presence of the AWS_PROCESS_BEANSTALK_WORKER_REQUESTS environment variable.
Register a middleware that will handle requests from the Elastic Beanstalk worker SQS Daemon.
def self.add_sqsd_middleware(app) is_eb_worker_hosted = Aws::Util.str_2_bool(ENV['AWS_PROCESS_BEANSTALK_WORKER_REQUESTS'].to_s.downcase) return unless is_eb_worker_hosted if app.config.force_ssl # SQS Daemon sends requests over HTTP - allow and process them before enforcing SSL. app.config.middleware.insert_before(ActionDispatch::SSL, Aws::Rails::EbsSqsActiveJobMiddleware) else app.config.middleware.use(Aws::Rails::EbsSqsActiveJobMiddleware) end end
def self.instrument_sdk_operations
client operations. Each operation will produce an event with a name:
Adds ActiveSupport Notifications instrumentation to AWS SDK
def self.instrument_sdk_operations Aws.constants.each do |c| m = Aws.const_get(c) if m.is_a?(Module) && m.const_defined?(:Client) && m.const_get(:Client).superclass == Seahorse::Client::Base m.const_get(:Client).add_plugin(Aws::Rails::Notifications) end end end
def self.log_to_rails_logger
def self.log_to_rails_logger Aws.config[:logger] = ::Rails.logger nil end
def self.use_rails_encrypted_credentials
def self.use_rails_encrypted_credentials # limit the config keys we merge to credentials only aws_credential_keys = %i[access_key_id secret_access_key session_token] Aws.config.merge!( ::Rails.application.credentials[:aws].to_h.slice(*aws_credential_keys) ) end