Class: Terraformer::Credentials::Aws
- Inherits:
-
Object
- Object
- Terraformer::Credentials::Aws
- Defined in:
- lib/terraformer/credentials/aws.rb
Constant Summary collapse
- KEYS =
%w(aws_region aws_access_key_id aws_secret_access_key).freeze
Class Method Summary collapse
Class Method Details
.get_from_options(options) ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/terraformer/credentials/aws.rb', line 20 def self.() KEYS.inject({}) do |credentials, key| aws_key = key.sub("aws_", "").to_sym credentials[aws_key] = [key.to_sym].nil? ? [key] : [key.to_sym] credentials[aws_key] = ENV[key.upcase] if credentials[aws_key].nil? raise AwsMissingCredentals.new(key) if credentials[aws_key].nil? credentials end end |