Class: Aws::InstanceProfileCredentials
- Inherits:
-
Object
- Object
- Aws::InstanceProfileCredentials
- Includes:
- CredentialProvider, RefreshingCredentials
- Defined in:
- lib/aws-sdk-core/instance_profile_credentials.rb
Defined Under Namespace
Classes: Non200Response, Token, TokenExpiredError, TokenRetrivalError
Constant Summary collapse
- NETWORK_ERRORS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
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.
[ Errno::EHOSTUNREACH, Errno::ECONNREFUSED, Errno::EHOSTDOWN, Errno::ENETUNREACH, SocketError, Timeout::Error, Non200Response ].freeze
- METADATA_PATH_BASE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Path base for GET request for profile and credentials
'/latest/meta-data/iam/security-credentials/'.freeze
- METADATA_TOKEN_PATH =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Path for PUT request for token
'/latest/api/token'.freeze
Instance Attribute Summary collapse
-
#retries ⇒ Integer
readonly
Number of times to retry when retrieving credentials from the instance metadata service.
Attributes included from CredentialProvider
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ InstanceProfileCredentials
constructor
A new instance of InstanceProfileCredentials.
Methods included from RefreshingCredentials
#credentials, #expiration, #refresh!
Methods included from CredentialProvider
Constructor Details
#initialize(options = {}) ⇒ InstanceProfileCredentials
Returns a new instance of InstanceProfileCredentials.
66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/aws-sdk-core/instance_profile_credentials.rb', line 66 def initialize( = {}) @retries = [:retries] || 1 endpoint_mode = resolve_endpoint_mode() @endpoint = resolve_endpoint(, endpoint_mode) @port = [:port] || 80 @http_open_timeout = [:http_open_timeout] || 1 @http_read_timeout = [:http_read_timeout] || 1 @http_debug_output = [:http_debug_output] @backoff = backoff([:backoff]) @token_ttl = [:token_ttl] || 21_600 @token = nil super end |
Instance Attribute Details
#retries ⇒ Integer (readonly)
Returns Number of times to retry when retrieving credentials from the instance metadata service. Defaults to 0 when resolving from the default credential chain (CredentialProviderChain).
83 84 85 |
# File 'lib/aws-sdk-core/instance_profile_credentials.rb', line 83 def retries @retries end |