Sha256: 8445fd5ad23924df3f40bb959202b52345199407f96331d08878500cec0de2b4

Contents?: true

Size: 791 Bytes

Versions: 3

Compression:

Stored size: 791 Bytes

Contents

require 'aws-sdk'
Aws.use_bundled_cert!
require_relative 'zenv'

module Smash
  module CloudPowers
    module Auth
      extend Smash::CloudPowers::Zenv

      # This method is able to be called before an object is instantiated in order
      # to provide a region in AWS-land.
      def self.region
        zfind(:aws_region) || 'us-west-2'
      end

      # This method is able to be called before an object is instantiated in order
      # to provide an Aws::Credentials object that will allow access to all the
      # resources in the account that zfind searches for, using the "ACCOUNT_NUMBER"
      # key.
      def self.creds
        @creds ||= Aws::Credentials.new(
          zfind(:aws_access_key_id),
          zfind(:aws_secret_access_key)
        )
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cloud_powers-0.2.5 lib/cloud_powers/auth.rb
cloud_powers-0.2.4 lib/cloud_powers/auth.rb
cloud_powers-0.2.3 lib/cloud_powers/auth.rb