CARVIEW |
Class: Aws::ECSCredentials
- Inherits:
-
Object
- Object
- Aws::ECSCredentials
- Includes:
- CredentialProvider
- Defined in:
- gems/aws-sdk-core/lib/aws-sdk-core/ecs_credentials.rb
Overview
Defined Under Namespace
Classes: InvalidTokenError, TokenFileReadError
Instance Attribute Summary collapse
-
#retries ⇒ Integer
readonly
The number of times to retry failed attempts 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 CredentialProvider
Constructor Details
#initialize(options = {}) ⇒ ECSCredentials
Returns a new instance of ECSCredentials.
Parameters:
- options (Hash) (defaults to: {})
Options Hash (options):
-
:retries
(Integer)
— default:
5
—
Number of times to retry when retrieving credentials.
-
:ip_address
(String)
— default:
'169.254.170.2'
—
This value is ignored if
endpoint
is set andcredential_path
is not set. -
:port
(Integer)
— default:
80
—
This value is ignored if
endpoint
is set andcredential_path
is not set. -
:credential_path
(String)
—
By default, the value of the AWS_CONTAINER_CREDENTIALS_RELATIVE_URI environment variable.
-
:endpoint
(String)
—
The container credential endpoint. By default, this is the value of the AWS_CONTAINER_CREDENTIALS_FULL_URI environment variable. This value is ignored if
credential_path
or ENV['AWS_CONTAINER_CREDENTIALS_RELATIVE_URI'] is set. - :http_open_timeout (Float) — default: 5
- :http_read_timeout (Float) — default: 5
-
:delay
(Numeric, Proc)
—
By default, failures are retried with exponential back-off, i.e.
sleep(1.2 ** num_failures)
. You can pass a number of seconds to sleep between failed attempts, or a Proc that accepts the number of failures. -
:http_debug_output
(IO)
— default:
nil
—
HTTP wire traces are sent to this object. You can specify something like $stdout.
-
before_refresh
(Callable)
—
Proc called before credentials are refreshed.
before_refresh
is called with an instance of this object when AWS credentials are required and need to be refreshed.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'gems/aws-sdk-core/lib/aws-sdk-core/ecs_credentials.rb', line 67 def initialize(options = {}) credential_path = options[:credential_path] || ENV['AWS_CONTAINER_CREDENTIALS_RELATIVE_URI'] endpoint = options[:endpoint] || ENV['AWS_CONTAINER_CREDENTIALS_FULL_URI'] initialize_uri(options, credential_path, endpoint) @retries = options[:retries] || 5 @http_open_timeout = options[:http_open_timeout] || 5 @http_read_timeout = options[:http_read_timeout] || 5 @http_debug_output = options[:http_debug_output] @backoff = backoff(options[:backoff]) @async_refresh = false @metrics = ['CREDENTIALS_HTTP'] super end |
Instance Attribute Details
#retries ⇒ Integer (readonly)
Returns The number of times to retry failed attempts to fetch credentials from the instance metadata service. Defaults to 0.
Returns:
-
(Integer)
—
The number of times to retry failed attempts to fetch credentials from the instance metadata service. Defaults to 0.
86 87 88 |
# File 'gems/aws-sdk-core/lib/aws-sdk-core/ecs_credentials.rb', line 86 def retries @retries end |