class App::AWSProfile

Public Class Methods

get() click to toggle source

Get the AWS profile. Returns either the profile (or nil). @return string

# File lib/core/aws_profile.rb, line 31
def self.get
    @@profile
end
get_profile_name() click to toggle source

Convenience method to just get the profile name. @return string

# File lib/core/aws_profile.rb, line 37
def self.get_profile_name
    return nil if @@credentials.nil?
    @@profile[PROFILE]
end
init(config_data) click to toggle source

Reads the config data and attempts to extract the profile. @return void

# File lib/core/aws_profile.rb, line 10
def self.init(config_data)

    errors                     = []

    # Get the profile out of the config YML.
    @@profile                  = config_data['AWS']['Profile'] if config_data.has_key?('AWS')

    # If no profile found, return.
    return if @@profile.nil?

    # Check the credentials exist.
    @@credentials, more_errors = Blufin::AWS::get_aws_credentials(@@profile)
    errors.concat(more_errors)

    # If anything is wrong, output error(s).
    Blufin::Config::invalid_configuration(App::GEM_NAME, errors) if errors.any?

end