Class: AWS::Core::CredentialProviders::EC2Provider
- Inherits:
-
Object
- Object
- AWS::Core::CredentialProviders::EC2Provider
- Includes:
- Provider
- Defined in:
- lib/aws/core/credential_providers.rb
Overview
This credential provider tries to get credentials from the EC2 metadata service.
Constant Summary
Constants included from Provider
Instance Attribute Summary collapse
- #http_debug_output ⇒ Object?
- #http_open_timeout ⇒ Float
- #http_read_timeout ⇒ Float
-
#ip_address ⇒ String
Defaults to ‘169.254.169.254’.
-
#port ⇒ Integer
Defaults to port 80.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ EC2Provider
constructor
A new instance of EC2Provider.
Methods included from Provider
#access_key_id, #credentials, #refresh, #secret_access_key, #session_token
Constructor Details
#initialize(options = {}) ⇒ EC2Provider
Returns a new instance of EC2Provider.
226 227 228 229 230 231 232 |
# File 'lib/aws/core/credential_providers.rb', line 226 def initialize = {} @ip_address = [:ip_address] || '169.254.169.254' @port = [:port] || 80 @http_open_timeout = [:http_open_timeout] || 1 @http_read_timeout = [:http_read_timeout] || 1 @http_debug_output = [:http_debug_output] end |
Instance Attribute Details
#http_debug_output ⇒ Object?
247 248 249 |
# File 'lib/aws/core/credential_providers.rb', line 247 def http_debug_output @http_debug_output end |
#http_open_timeout ⇒ Float
241 242 243 |
# File 'lib/aws/core/credential_providers.rb', line 241 def http_open_timeout @http_open_timeout end |
#http_read_timeout ⇒ Float
244 245 246 |
# File 'lib/aws/core/credential_providers.rb', line 244 def http_read_timeout @http_read_timeout end |
#ip_address ⇒ String
Returns Defaults to ‘169.254.169.254’.
235 236 237 |
# File 'lib/aws/core/credential_providers.rb', line 235 def ip_address @ip_address end |
#port ⇒ Integer
Returns Defaults to port 80.
238 239 240 |
# File 'lib/aws/core/credential_providers.rb', line 238 def port @port end |