aws-sdk-core 2.1.36 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a8306d0a15d6533fc71e7c838e59380287d637aa
4
- data.tar.gz: d6215f17b1b20b72ad4fea251f85d09734b0aa32
3
+ metadata.gz: b605693b7d8841a32c221c9df5309edabe21d871
4
+ data.tar.gz: cea7d573569b1db856062db462abdfe16b5193df
5
5
  SHA512:
6
- metadata.gz: 30cc7f1ddbd29a1f458dc8e6e7853518639d32fced4e09f7ef9f9cb01fac54cd686dbc0a0527a100c516bbf844e448c68ccf60d055c2d80679f6aa86df9f26aa
7
- data.tar.gz: a0bdc87f8144245242c77423eff94122b25f834ecdb1807a28b7950b6e6b457fc08b617d7b939ade7427bc1c3343549eb615286b3f2422b8a1d057d0a119c4b0
6
+ metadata.gz: 6892e6e21a5120d7c4a385295d98f16f69f7d44b18ad1880b368034eb3e328dd9103d48660dc488963c0d1cd4a7e57e993c2c114de17c35b90decf8a260ac7c5
7
+ data.tar.gz: dd29ab0659cffeca72ddfb216026e29ef7537c543c727a831b0255d54e707eb92ae1fa09405e27f70b1fb21a340aabd0978138c8fd11d145d05787768388f8ed
@@ -7,8 +7,9 @@
7
7
  "operation": "DescribeInstances",
8
8
  "acceptors": [
9
9
  {
10
- "matcher": "status",
11
- "expected": 200,
10
+ "matcher": "path",
11
+ "expected": true,
12
+ "argument": "length(Reservations[]) > `0`",
12
13
  "state": "success"
13
14
  },
14
15
  {
@@ -425,6 +425,15 @@
425
425
  "senderFault":true
426
426
  },
427
427
  "exception":true
428
+ },
429
+ {
430
+ "shape":"KMSKeyNotAccessibleFault",
431
+ "error":{
432
+ "code":"KMSKeyNotAccessibleFault",
433
+ "httpStatusCode":400,
434
+ "senderFault":true
435
+ },
436
+ "exception":true
428
437
  }
429
438
  ]
430
439
  },
@@ -1740,6 +1749,30 @@
1740
1749
  }
1741
1750
  ]
1742
1751
  },
1752
+ "DescribeDBSnapshotAttributes":{
1753
+ "name":"DescribeDBSnapshotAttributes",
1754
+ "http":{
1755
+ "method":"POST",
1756
+ "requestUri":"/"
1757
+ },
1758
+ "input":{"shape":"DescribeDBSnapshotAttributesMessage"},
1759
+ "output":{
1760
+ "shape":"DescribeDBSnapshotAttributesResult",
1761
+ "wrapper":true,
1762
+ "resultWrapper":"DescribeDBSnapshotAttributesResult"
1763
+ },
1764
+ "errors":[
1765
+ {
1766
+ "shape":"DBSnapshotNotFoundFault",
1767
+ "error":{
1768
+ "code":"DBSnapshotNotFound",
1769
+ "httpStatusCode":404,
1770
+ "senderFault":true
1771
+ },
1772
+ "exception":true
1773
+ }
1774
+ ]
1775
+ },
1743
1776
  "DescribeDBSnapshots":{
1744
1777
  "name":"DescribeDBSnapshots",
1745
1778
  "http":{
@@ -2400,6 +2433,48 @@
2400
2433
  }
2401
2434
  ]
2402
2435
  },
2436
+ "ModifyDBSnapshotAttribute":{
2437
+ "name":"ModifyDBSnapshotAttribute",
2438
+ "http":{
2439
+ "method":"POST",
2440
+ "requestUri":"/"
2441
+ },
2442
+ "input":{"shape":"ModifyDBSnapshotAttributeMessage"},
2443
+ "output":{
2444
+ "shape":"ModifyDBSnapshotAttributeResult",
2445
+ "wrapper":true,
2446
+ "resultWrapper":"ModifyDBSnapshotAttributeResult"
2447
+ },
2448
+ "errors":[
2449
+ {
2450
+ "shape":"DBSnapshotNotFoundFault",
2451
+ "error":{
2452
+ "code":"DBSnapshotNotFound",
2453
+ "httpStatusCode":404,
2454
+ "senderFault":true
2455
+ },
2456
+ "exception":true
2457
+ },
2458
+ {
2459
+ "shape":"InvalidDBSnapshotStateFault",
2460
+ "error":{
2461
+ "code":"InvalidDBSnapshotState",
2462
+ "httpStatusCode":400,
2463
+ "senderFault":true
2464
+ },
2465
+ "exception":true
2466
+ },
2467
+ {
2468
+ "shape":"SharedSnapshotQuotaExceededFault",
2469
+ "error":{
2470
+ "code":"SharedSnapshotQuotaExceeded",
2471
+ "httpStatusCode":400,
2472
+ "senderFault":true
2473
+ },
2474
+ "exception":true
2475
+ }
2476
+ ]
2477
+ },
2403
2478
  "ModifyDBSubnetGroup":{
2404
2479
  "name":"ModifyDBSubnetGroup",
2405
2480
  "http":{
@@ -2951,6 +3026,15 @@
2951
3026
  "senderFault":true
2952
3027
  },
2953
3028
  "exception":true
3029
+ },
3030
+ {
3031
+ "shape":"KMSKeyNotAccessibleFault",
3032
+ "error":{
3033
+ "code":"KMSKeyNotAccessibleFault",
3034
+ "httpStatusCode":400,
3035
+ "senderFault":true
3036
+ },
3037
+ "exception":true
2954
3038
  }
2955
3039
  ]
2956
3040
  },
@@ -3101,6 +3185,15 @@
3101
3185
  "senderFault":true
3102
3186
  },
3103
3187
  "exception":true
3188
+ },
3189
+ {
3190
+ "shape":"KMSKeyNotAccessibleFault",
3191
+ "error":{
3192
+ "code":"KMSKeyNotAccessibleFault",
3193
+ "httpStatusCode":400,
3194
+ "senderFault":true
3195
+ },
3196
+ "exception":true
3104
3197
  }
3105
3198
  ]
3106
3199
  },
@@ -3557,6 +3650,13 @@
3557
3650
  "OptInType":{"shape":"String"}
3558
3651
  }
3559
3652
  },
3653
+ "AttributeValueList":{
3654
+ "type":"list",
3655
+ "member":{
3656
+ "shape":"String",
3657
+ "locationName":"AttributeValue"
3658
+ }
3659
+ },
3560
3660
  "AuthorizationAlreadyExistsFault":{
3561
3661
  "type":"structure",
3562
3662
  "members":{
@@ -3946,7 +4046,8 @@
3946
4046
  "PreferredBackupWindow":{"shape":"String"},
3947
4047
  "PreferredMaintenanceWindow":{"shape":"String"},
3948
4048
  "DBClusterMembers":{"shape":"DBClusterMemberList"},
3949
- "VpcSecurityGroups":{"shape":"VpcSecurityGroupMembershipList"}
4049
+ "VpcSecurityGroups":{"shape":"VpcSecurityGroupMembershipList"},
4050
+ "HostedZoneId":{"shape":"String"}
3950
4051
  },
3951
4052
  "wrapper":true
3952
4053
  },
@@ -4481,6 +4582,29 @@
4481
4582
  },
4482
4583
  "exception":true
4483
4584
  },
4585
+ "DBSnapshotAttribute":{
4586
+ "type":"structure",
4587
+ "members":{
4588
+ "AttributeName":{"shape":"String"},
4589
+ "AttributeValues":{"shape":"AttributeValueList"}
4590
+ },
4591
+ "wrapper":true
4592
+ },
4593
+ "DBSnapshotAttributeList":{
4594
+ "type":"list",
4595
+ "member":{
4596
+ "shape":"DBSnapshotAttribute",
4597
+ "locationName":"DBSnapshotAttribute"
4598
+ }
4599
+ },
4600
+ "DBSnapshotAttributesResult":{
4601
+ "type":"structure",
4602
+ "members":{
4603
+ "DBSnapshotIdentifier":{"shape":"String"},
4604
+ "DBSnapshotAttributes":{"shape":"DBSnapshotAttributeList"}
4605
+ },
4606
+ "wrapper":true
4607
+ },
4484
4608
  "DBSnapshotList":{
4485
4609
  "type":"list",
4486
4610
  "member":{
@@ -4822,6 +4946,12 @@
4822
4946
  "Marker":{"shape":"String"}
4823
4947
  }
4824
4948
  },
4949
+ "DescribeDBSnapshotAttributesMessage":{
4950
+ "type":"structure",
4951
+ "members":{
4952
+ "DBSnapshotIdentifier":{"shape":"String"}
4953
+ }
4954
+ },
4825
4955
  "DescribeDBSnapshotsMessage":{
4826
4956
  "type":"structure",
4827
4957
  "members":{
@@ -4830,7 +4960,9 @@
4830
4960
  "SnapshotType":{"shape":"String"},
4831
4961
  "Filters":{"shape":"FilterList"},
4832
4962
  "MaxRecords":{"shape":"IntegerOptional"},
4833
- "Marker":{"shape":"String"}
4963
+ "Marker":{"shape":"String"},
4964
+ "IncludeShared":{"shape":"Boolean"},
4965
+ "IncludePublic":{"shape":"Boolean"}
4834
4966
  }
4835
4967
  },
4836
4968
  "DescribeDBSubnetGroupsMessage":{
@@ -5008,7 +5140,8 @@
5008
5140
  "type":"structure",
5009
5141
  "members":{
5010
5142
  "Address":{"shape":"String"},
5011
- "Port":{"shape":"Integer"}
5143
+ "Port":{"shape":"Integer"},
5144
+ "HostedZoneId":{"shape":"String"}
5012
5145
  }
5013
5146
  },
5014
5147
  "EngineDefaults":{
@@ -5435,7 +5568,8 @@
5435
5568
  "TdeCredentialArn":{"shape":"String"},
5436
5569
  "TdeCredentialPassword":{"shape":"String"},
5437
5570
  "CACertificateIdentifier":{"shape":"String"},
5438
- "CopyTagsToSnapshot":{"shape":"BooleanOptional"}
5571
+ "CopyTagsToSnapshot":{"shape":"BooleanOptional"},
5572
+ "PubliclyAccessible":{"shape":"BooleanOptional"}
5439
5573
  }
5440
5574
  },
5441
5575
  "ModifyDBParameterGroupMessage":{
@@ -5449,6 +5583,16 @@
5449
5583
  "Parameters":{"shape":"ParametersList"}
5450
5584
  }
5451
5585
  },
5586
+ "ModifyDBSnapshotAttributeMessage":{
5587
+ "type":"structure",
5588
+ "required":["DBSnapshotIdentifier"],
5589
+ "members":{
5590
+ "DBSnapshotIdentifier":{"shape":"String"},
5591
+ "AttributeName":{"shape":"String"},
5592
+ "ValuesToAdd":{"shape":"AttributeValueList"},
5593
+ "ValuesToRemove":{"shape":"AttributeValueList"}
5594
+ }
5595
+ },
5452
5596
  "ModifyDBSubnetGroupMessage":{
5453
5597
  "type":"structure",
5454
5598
  "required":[
@@ -6161,6 +6305,17 @@
6161
6305
  },
6162
6306
  "exception":true
6163
6307
  },
6308
+ "SharedSnapshotQuotaExceededFault":{
6309
+ "type":"structure",
6310
+ "members":{
6311
+ },
6312
+ "error":{
6313
+ "code":"SharedSnapshotQuotaExceeded",
6314
+ "httpStatusCode":400,
6315
+ "senderFault":true
6316
+ },
6317
+ "exception":true
6318
+ },
6164
6319
  "SnapshotQuotaExceededFault":{
6165
6320
  "type":"structure",
6166
6321
  "members":{
@@ -6196,6 +6351,7 @@
6196
6351
  "db-instance",
6197
6352
  "db-parameter-group",
6198
6353
  "db-security-group",
6354
+ "db-snapshot",
6199
6355
  "db-cluster",
6200
6356
  "db-cluster-snapshot"
6201
6357
  ]
@@ -6493,6 +6649,12 @@
6493
6649
  "EventSubscription":{"shape":"EventSubscription"}
6494
6650
  }
6495
6651
  },
6652
+ "DescribeDBSnapshotAttributesResult":{
6653
+ "type":"structure",
6654
+ "members":{
6655
+ "DBSnapshotAttributesResult":{"shape":"DBSnapshotAttributesResult"}
6656
+ }
6657
+ },
6496
6658
  "DescribeEngineDefaultClusterParametersResult":{
6497
6659
  "type":"structure",
6498
6660
  "members":{
@@ -6523,6 +6685,12 @@
6523
6685
  "DBInstance":{"shape":"DBInstance"}
6524
6686
  }
6525
6687
  },
6688
+ "ModifyDBSnapshotAttributeResult":{
6689
+ "type":"structure",
6690
+ "members":{
6691
+ "DBSnapshotAttributesResult":{"shape":"DBSnapshotAttributesResult"}
6692
+ }
6693
+ },
6526
6694
  "ModifyDBSubnetGroupResult":{
6527
6695
  "type":"structure",
6528
6696
  "members":{
@@ -5,13 +5,13 @@ module Aws
5
5
  # An auto-refreshing credential provider that works by assuming
6
6
  # a role via {Aws::STS::Client#assume_role}.
7
7
  #
8
- # role_credentials = Aws::AssumeRoleCredentials.new(
9
- # client: Aws::STS::Client.new(...),
10
- # role_arn: "linked::account::arn",
11
- # role_session_name: "session-name"
12
- # )
8
+ # role_credentials = Aws::AssumeRoleCredentials.new(
9
+ # client: Aws::STS::Client.new(...),
10
+ # role_arn: "linked::account::arn",
11
+ # role_session_name: "session-name"
12
+ # )
13
13
  #
14
- # ec2 = Aws::EC2::Client.new(credentials: role_credentials)
14
+ # ec2 = Aws::EC2::Client.new(credentials: role_credentials)
15
15
  #
16
16
  # If you omit `:client` option, a new {STS::Client} object will be
17
17
  # constructed.
@@ -6,29 +6,18 @@ module Aws
6
6
  # @api private
7
7
  class S3RequestSigner < Seahorse::Client::Plugin
8
8
 
9
- class SigningHandler < RequestSigner::Handler
9
+ option(:signature_version, 'v4')
10
10
 
11
- # List of regions that support older S3 signature versions.
12
- # All new regions only support signature version 4.
13
- V2_REGIONS = Set.new(%w(
14
- us-east-1
15
- us-west-1
16
- us-west-2
17
- ap-northeast-1
18
- ap-southeast-1
19
- ap-southeast-2
20
- sa-east-1
21
- eu-west-1
22
- us-gov-west-1
23
- ))
11
+ class SigningHandler < RequestSigner::Handler
24
12
 
25
13
  def call(context)
26
14
  require_credentials(context)
27
- version = signature_version(context)
28
- case version
29
- when /v4/ then apply_v4_signature(context)
30
- when /s3/ then apply_v2_signature(context)
31
- else raise "unsupported signature version #{version.inspect}"
15
+ case context.config.signature_version
16
+ when 'v4' then apply_v4_signature(context)
17
+ when 's3' then apply_s3_legacy_signature(context)
18
+ else
19
+ raise "unsupported signature version #{version.inspect}, valid"\
20
+ " options: 'v4' (default), 's3'"
32
21
  end
33
22
  @handler.call(context)
34
23
  end
@@ -42,59 +31,10 @@ module Aws
42
31
  ).sign(context.http_request)
43
32
  end
44
33
 
45
- def apply_v2_signature(context)
34
+ def apply_s3_legacy_signature(context)
46
35
  Signers::S3.sign(context)
47
36
  end
48
37
 
49
- def signature_version(context)
50
- context[:cached_signature_version] ||
51
- context.config.signature_version ||
52
- version_by_region(context)
53
- end
54
-
55
- def version_by_region(context)
56
- if classic_endpoint?(context)
57
- classic_sigv(context)
58
- else
59
- regional_sigv(context)
60
- end
61
- end
62
-
63
- def classic_endpoint?(context)
64
- context.config.region == 'us-east-1'
65
- end
66
-
67
- # When accessing the classic endpoint, s3.amazonaws.com, we don't know
68
- # the region name. This makes creating a version 4 signature difficult.
69
- # Choose v4 only if using KMS encryptions, which requires v4.
70
- def classic_sigv(context)
71
- if kms_encrypted?(context)
72
- :v4
73
- else
74
- :s3
75
- end
76
- end
77
-
78
- def regional_sigv(context)
79
- # Drop back to older S3 signature version when uploading objects for
80
- # better performance. This optimization may be removed at some point
81
- # in favor of always using signature version 4.
82
- if V2_REGIONS.include?(context.config.region)
83
- uploading_file?(context) && !kms_encrypted?(context) ? :s3 : :v4
84
- else
85
- :v4
86
- end
87
- end
88
-
89
- def kms_encrypted?(context)
90
- context.params[:server_side_encryption] == 'aws:kms'
91
- end
92
-
93
- def uploading_file?(context)
94
- [:put_object, :upload_part].include?(context.operation_name) &&
95
- context.http_request.body.size > 0
96
- end
97
-
98
38
  end
99
39
 
100
40
  # Abstract base class for the other two handlers
@@ -105,7 +45,7 @@ module Aws
105
45
  def new_hostname(context, region)
106
46
  bucket = context.params[:bucket]
107
47
  if region == 'us-east-1'
108
- "#{bucket}.s3-external-1.amazonaws.com"
48
+ "#{bucket}.s3.amazonaws.com"
109
49
  else
110
50
  bucket + '.' + URI.parse(EndpointProvider.resolve(region, 's3')).host
111
51
  end
@@ -137,13 +77,11 @@ module Aws
137
77
 
138
78
  end
139
79
 
140
- # This handler detects when a request fails because signature version 4
141
- # is required but not used. It follows up by making a request to
142
- # determine the correct region, then finally a version 4 signed
143
- # request against the regional endpoint.
144
- class BucketSigningErrorHandler < Handler
145
-
146
- SIGV4_MSG = /(Please use AWS4-HMAC-SHA256|AWS Signature Version 4)/
80
+ # This handler detects when a request fails because of a mismatched bucket
81
+ # region. It follows up by making a request to determine the correct
82
+ # region, then finally a version 4 signed request against the correct
83
+ # regional endpoint.
84
+ class BucketRegionErrorHandler < Handler
147
85
 
148
86
  def call(context)
149
87
  response = @handler.call(context)
@@ -153,52 +91,34 @@ module Aws
153
91
  private
154
92
 
155
93
  def handle_region_errors(response)
156
- if sigv4_required_error?(response)
157
- detect_region_and_retry(response)
158
- elsif wrong_sigv4_region?(response)
159
- extract_body_region_and_retry(response.context)
94
+ if wrong_sigv4_region?(response)
95
+ get_region_and_retry(response.context)
160
96
  else
161
97
  response
162
98
  end
163
99
  end
164
100
 
165
- def sigv4_required_error?(resp)
166
- resp.context.http_response.status_code == 400 &&
167
- resp.context.http_response.body_contents.match(SIGV4_MSG) &&
168
- resp.context.http_response.body.respond_to?(:truncate)
169
- end
170
-
171
- def wrong_sigv4_region?(resp)
172
- resp.context.http_response.status_code == 400 &&
173
- resp.context.http_response.body_contents.match(/<Region>.+?<\/Region>/)
174
- end
175
-
176
- def extract_body_region_and_retry(context)
101
+ def get_region_and_retry(context)
177
102
  actual_region = region_from_body(context)
178
- updgrade_to_v4(context, actual_region)
103
+ if actual_region.nil? || actual_region == ""
104
+ raise "Couldn't get region from body: #{context.body}"
105
+ end
106
+ update_bucket_cache(context, actual_region)
179
107
  log_warning(context, actual_region)
108
+ update_region_header(context, actual_region)
180
109
  @handler.call(context)
181
110
  end
182
111
 
183
- def region_from_body(context)
184
- context.http_response.body_contents.match(/<Region>(.+?)<\/Region>/)[1]
112
+ def update_bucket_cache(context, actual_region)
113
+ S3::BUCKET_REGIONS[context.params[:bucket]] = actual_region
185
114
  end
186
115
 
187
- def detect_region_and_retry(resp)
188
- context = resp.context
189
- updgrade_to_v4(context, 'us-east-1')
190
- resp = @handler.call(context)
191
- if resp.successful?
192
- resp
193
- else
194
- actual_region = region_from_location_header(context)
195
- updgrade_to_v4(context, actual_region)
196
- log_warning(context, actual_region)
197
- @handler.call(context)
198
- end
116
+ def wrong_sigv4_region?(resp)
117
+ resp.context.http_response.status_code == 400 &&
118
+ resp.context.http_response.body_contents.match(/<Region>.+?<\/Region>/)
199
119
  end
200
120
 
201
- def updgrade_to_v4(context, region)
121
+ def update_region_header(context, region)
202
122
  context.http_response.body.truncate(0)
203
123
  context.http_request.headers.delete('authorization')
204
124
  context.http_request.headers.delete('x-amz-security-token')
@@ -207,13 +127,11 @@ module Aws
207
127
  signer.sign(context.http_request)
208
128
  end
209
129
 
210
- def region_from_location_header(context)
211
- location = context.http_response.headers['location']
212
- location.match(/s3[.-](.+?)\.amazonaws\.com/)[1]
130
+ def region_from_body(context)
131
+ context.http_response.body_contents.match(/<Region>(.+?)<\/Region>/)[1]
213
132
  end
214
133
 
215
134
  def log_warning(context, actual_region)
216
- S3::BUCKET_REGIONS[context.params[:bucket]] = actual_region
217
135
  msg = "S3 client configured for #{context.config.region.inspect} " +
218
136
  "but the bucket #{context.params[:bucket].inspect} is in " +
219
137
  "#{actual_region.inspect}; Please configure the proper region " +
@@ -234,7 +152,7 @@ module Aws
234
152
  handler(SigningHandler, step: :sign)
235
153
 
236
154
  # AFTER signing
237
- handle(BucketSigningErrorHandler, step: :sign, priority: 40)
155
+ handle(BucketRegionErrorHandler, step: :sign, priority: 40)
238
156
 
239
157
  end
240
158
  end
@@ -1,3 +1,3 @@
1
1
  module Aws
2
- VERSION = '2.1.36'
2
+ VERSION = '2.2.0'
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.1.36
4
+ version: 2.2.0
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-11-10 00:00:00.000000000 Z
11
+ date: 2015-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jmespath