aws-sdk-core 2.0.24 → 2.0.25

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,9 +11,6 @@
11
11
  "us-gov-west-1/iam": {
12
12
  "endpoint": "iam.us-gov.amazonaws.com"
13
13
  },
14
- "us-gov-west-1/sts": {
15
- "endpoint": "sts.us-gov-west-1.amazonaws.com"
16
- },
17
14
  "us-gov-west-1/s3": {
18
15
  "endpoint": "s3-{region}.amazonaws.com"
19
16
  },
@@ -29,9 +26,6 @@
29
26
  "*/route53": {
30
27
  "endpoint": "route53.amazonaws.com"
31
28
  },
32
- "*/sts": {
33
- "endpoint": "sts.amazonaws.com"
34
- },
35
29
  "us-east-1/sdb": {
36
30
  "endpoint": "sdb.amazonaws.com"
37
31
  },
@@ -57,6 +57,7 @@ module Aws
57
57
  SimpleDB
58
58
  SNS
59
59
  SQS
60
+ SSM
60
61
  StorageGateway
61
62
  STS
62
63
  Support
@@ -23,7 +23,11 @@ module Aws
23
23
  [:env_credentials, { prefix: 'AMAZON' }],
24
24
  [:env_credentials, { key:'AWS_ACCESS_KEY', secret:'AWS_SECRET_KEY' }],
25
25
  [:shared_credentials, {}],
26
- [:instance_profile_credentials, {}],
26
+ [:instance_profile_credentials, {
27
+ retries: 0,
28
+ http_open_timeout: 1,
29
+ http_read_timeout: 1,
30
+ }],
27
31
  ]
28
32
  end
29
33
 
@@ -54,8 +58,8 @@ module Aws
54
58
  nil
55
59
  end
56
60
 
57
- def instance_profile_credentials(*args)
58
- InstanceProfileCredentials.new
61
+ def instance_profile_credentials(options)
62
+ InstanceProfileCredentials.new(options)
59
63
  end
60
64
 
61
65
  end
@@ -25,22 +25,27 @@ module Aws
25
25
  ]
26
26
 
27
27
  # @param [Hash] options
28
- # @option options [Integer] :retries (0) Number of times to retry
28
+ # @option options [Integer] :retries (5) Number of times to retry
29
29
  # when retrieving credentials.
30
30
  # @option options [String] :ip_address ('169.254.169.254')
31
31
  # @option options [Integer] :port (80)
32
- # @option options [Float] :http_open_timeout (1)
33
- # @option options [Float] :http_read_timeout (1)
32
+ # @option options [Float] :http_open_timeout (5)
33
+ # @option options [Float] :http_read_timeout (5)
34
+ # @option options [Numeric, Proc] :delay By default, failures are retried
35
+ # with exponential back-off, i.e. `sleep(1.2 ** num_failures)`. You can
36
+ # pass a number of seconds to sleep between failed attempts, or
37
+ # a Proc that accepts the number of failures.
34
38
  # @option options [IO] :http_debug_output (nil) HTTP wire
35
39
  # traces are sent to this object. You can specify something
36
40
  # like $stdout.
37
41
  def initialize options = {}
38
- @retries = options[:retries] || 0
42
+ @retries = options[:retries] || 5
39
43
  @ip_address = options[:ip_address] || '169.254.169.254'
40
44
  @port = options[:port] || 80
41
- @http_open_timeout = options[:http_open_timeout] || 1
42
- @http_read_timeout = options[:http_read_timeout] || 1
45
+ @http_open_timeout = options[:http_open_timeout] || 5
46
+ @http_read_timeout = options[:http_read_timeout] || 5
43
47
  @http_debug_output = options[:http_debug_output]
48
+ @backoff = backoff(options[:backoff])
44
49
  super
45
50
  end
46
51
 
@@ -50,6 +55,14 @@ module Aws
50
55
 
51
56
  private
52
57
 
58
+ def backoff(backoff)
59
+ case backoff
60
+ when Proc then backoff
61
+ when Numeric then lambda { |_| sleep(backoff) }
62
+ else lambda { |num_failures| Kernel.sleep(1.2 ** num_failures) }
63
+ end
64
+ end
65
+
53
66
  def refresh
54
67
  credentials = MultiJson.load(get_credentials)
55
68
  @access_key_id = credentials['AccessKeyId']
@@ -72,7 +85,7 @@ module Aws
72
85
  end
73
86
  rescue *FAILURES => e
74
87
  if failed_attempts < @retries
75
- backoff(failed_attempts)
88
+ @backoff.call(failed_attempts)
76
89
  failed_attempts += 1
77
90
  retry
78
91
  else
@@ -81,10 +94,6 @@ module Aws
81
94
  end
82
95
  end
83
96
 
84
- def backoff(failed_attempts)
85
- Kernel.sleep(2 ** failed_attempts)
86
- end
87
-
88
97
  def open_connection
89
98
  http = Net::HTTP.new(@ip_address, @port, nil)
90
99
  http.open_timeout = @http_open_timeout
@@ -6,7 +6,7 @@ module Aws
6
6
  # @api private
7
7
  class S3RequestSigner < Seahorse::Client::Plugin
8
8
 
9
- class SigningHandler < Seahorse::Client::Handler
9
+ class SigningHandler < RequestSigner::Handler
10
10
 
11
11
  # List of regions that support older S3 signature versions.
12
12
  # All new regions only support signature version 4.
@@ -23,6 +23,7 @@ module Aws
23
23
  ))
24
24
 
25
25
  def call(context)
26
+ require_credentials(context)
26
27
  version = signature_version(context)
27
28
  case version
28
29
  when /v4/ then apply_v4_signature(context)
@@ -91,7 +91,7 @@ module Aws
91
91
  if section
92
92
  current_section = section[1]
93
93
  elsif current_section
94
- item = line.match(/^\s*(.+?)\s*=\s*(.+)\s*$/) unless line.nil?
94
+ item = line.match(/^\s*(.+?)\s*=\s*(.+?)\s*$/) unless line.nil?
95
95
  if item
96
96
  map[current_section] = map[current_section] || {}
97
97
  map[current_section][item[1]] = item[2]
@@ -0,0 +1,4 @@
1
+ Aws.add_service(:SSM, {
2
+ api: File.join(Aws::API_DIR, 'SSM.api.json'),
3
+ docs: File.join(Aws::API_DIR, 'SSM.docs.json'),
4
+ })
@@ -1,3 +1,3 @@
1
1
  module Aws
2
- VERSION = '2.0.24'
2
+ VERSION = '2.0.25'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.24
4
+ version: 2.0.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-12 00:00:00.000000000 Z
11
+ date: 2015-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -66,8 +66,10 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.0'
69
- description: Provides API clients for AWS.
70
- email:
69
+ description: Provides API clients for AWS. This gem is part of the official AWS SDK
70
+ for Ruby.
71
+ email:
72
+ - trevrowe@amazon.com
71
73
  executables:
72
74
  - aws.rb
73
75
  extensions: []
@@ -161,6 +163,7 @@ files:
161
163
  - apis/SNS.resources.json
162
164
  - apis/SQS.api.json
163
165
  - apis/SQS.paginators.json
166
+ - apis/SSM.api.json
164
167
  - apis/STS.api.json
165
168
  - apis/SWF.api.json
166
169
  - apis/SWF.paginators.json
@@ -292,6 +295,7 @@ files:
292
295
  - lib/aws-sdk-core/simpledb.rb
293
296
  - lib/aws-sdk-core/sns.rb
294
297
  - lib/aws-sdk-core/sqs.rb
298
+ - lib/aws-sdk-core/ssm.rb
295
299
  - lib/aws-sdk-core/storagegateway.rb
296
300
  - lib/aws-sdk-core/structure.rb
297
301
  - lib/aws-sdk-core/sts.rb
@@ -353,7 +357,7 @@ files:
353
357
  - lib/seahorse/model/shapes.rb
354
358
  - lib/seahorse/util.rb
355
359
  - lib/seahorse/version.rb
356
- homepage: http://github.com/aws/aws-sdk-core-ruby
360
+ homepage: http://github.com/aws/aws-sdk-ruby
357
361
  licenses:
358
362
  - Apache 2.0
359
363
  metadata: {}