Class AWS::Core::CredentialProviders::EC2Provider
In: lib/aws/core/credential_providers.rb
Parent: Object

This credential provider tries to get credentials from the EC2 metadata service.

Methods

Included Modules

Provider

Classes and Modules

Class AWS::Core::CredentialProviders::EC2Provider::FailedRequestError

Constants

FAILURES = [ FailedRequestError, Errno::EHOSTUNREACH, Errno::ECONNREFUSED, SocketError, Timeout::Error, ]   These are the errors we trap when attempting to talk to the instance metadata service. Any of these imply the service is not present, no responding or some other non-recoverable error. @api private

Attributes

credentials_expiration  [RW]  @return [Time,nil]
http_debug_output  [RW]  @return [Object,nil]
http_open_timeout  [RW]  @return [Float]
http_read_timeout  [RW]  @return [Float]
ip_address  [RW]  @return [String] Defaults to ‘169.254.169.254’.
port  [RW]  @return [Integer] Defaults to port 80.

Public Class methods

@param [Hash] options @option options [String] :ip_address (‘169.254.169.254’) @option options [Integer] :port (80) @option options [Float] :http_open_timeout (1) @option options [Float] :http_read_timeout (1) @option options [Object] :http_debug_output (nil) HTTP wire

  traces are sent to this object.  You can specify something
  like $stdout.

Public Instance methods

Refresh provider if existing credentials will be expired in 5 min @return [Hash] Returns a hash of credentials containg at least

  the `:access_key_id` and `:secret_access_key`.  The hash may
  also contain a `:session_token`.

@raise [Errors::MissingCredentialsError] Raised when the

  `:access_key_id` or the `:secret_access_key` can not be found.

Protected Instance methods

Makes an HTTP Get request with the given path. If a non-200 response is received, then a FailedRequestError is raised. a {FailedRequestError} is raised. @param [Net::HTTPSession] session @param [String] path @raise [FailedRequestError] @return [String] Returns the http response body.

[Validate]