Fetches credentials from the environment (ENV). You construct an ENV provider with a prefix. Given the prefix “AWS” ENV will be checked for the following keys:
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_SESSION_TOKEN (optional)
@return [String]
@param [String] prefix The prefix to apply to the ENV variable.
# File lib/aws/core/credential_providers.rb, line 184 def initialize prefix @prefix = prefix end
(see AWS::Core::CredentialProviders::Provider#get_credentials)
# File lib/aws/core/credential_providers.rb, line 192 def get_credentials credentials = {} KEYS.each do |key| if value = ENV["#{@prefix}_#{key.to_s.upcase}"] credentials[key] = value end end credentials end