Class: Aws::ECSCredentials
- Inherits:
-
Object
- Object
- Aws::ECSCredentials
- Includes:
- CredentialProvider, RefreshingCredentials
- Defined in:
- lib/aws-sdk-core/ecs_credentials.rb
Defined Under Namespace
Classes: Non200Response
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, ]
Instance Attribute Summary collapse
-
#retries ⇒ Integer
readonly
The number of times to retry failed atttempts to fetch credentials from the instance metadata service.
Attributes included from CredentialProvider
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ ECSCredentials
constructor
A new instance of ECSCredentials.
Methods included from RefreshingCredentials
#credentials, #expiration, #refresh!
Methods included from CredentialProvider
#access_key_id, #secret_access_key, #session_token, #set?
Methods included from Deprecations
Constructor Details
#initialize(options = {}) ⇒ ECSCredentials
Returns a new instance of ECSCredentials.
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/aws-sdk-core/ecs_credentials.rb', line 45 def initialize = {} @retries = [:retries] || 5 @ip_address = [:ip_address] || '169.254.170.2' @port = [:port] || 80 @credential_path = [:credential_path] @credential_path ||= ENV['AWS_CONTAINER_CREDENTIALS_RELATIVE_URI'] unless @credential_path raise ArgumentError.new( "Cannot instantiate an ECS Credential Provider without a credential path." ) end @http_open_timeout = [:http_open_timeout] || 5 @http_read_timeout = [:http_read_timeout] || 5 @http_debug_output = [:http_debug_output] @backoff = backoff([:backoff]) super end |
Instance Attribute Details
#retries ⇒ Integer (readonly)
Returns The number of times to retry failed atttempts to fetch credentials from the instance metadata service. Defaults to 0.
65 66 67 |
# File 'lib/aws-sdk-core/ecs_credentials.rb', line 65 def retries @retries end |