module Fog::AWS::CredentialFetcher::ConnectionMethods
Public Instance Methods
Source
# File lib/fog/aws/credential_fetcher.rb, line 134 def refresh_credentials_if_expired refresh_credentials if credentials_expired? end
Private Instance Methods
Source
# File lib/fog/aws/credential_fetcher.rb, line 147 def credentials_expired? @use_iam_profile && (!@aws_credentials_expire_at || (@aws_credentials_expire_at && Fog::Time.now > @aws_credentials_expire_at - credentials_refresh_threshold)) #new credentials become available from around 5 minutes before expiration time end
Source
# File lib/fog/aws/credential_fetcher.rb, line 143 def credentials_refresh_threshold @aws_credentials_refresh_threshold_seconds || 15 end
When defined, ‘aws_credentials_refresh_threshold_seconds’ controls when the credential needs to be refreshed, expressed in seconds before the current credential’s expiration time
Source
# File lib/fog/aws/credential_fetcher.rb, line 153 def refresh_credentials if @use_iam_profile new_credentials = service.fetch_credentials :use_iam_profile => @use_iam_profile, :region => @region if new_credentials.any? setup_credentials new_credentials return true else false end else false end end