aws-sdk-core 2.0.0.rc4 → 2.0.0.rc5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/apis/CloudFront-2013-11-11.json +5502 -0
- data/apis/CloudWatch-2010-08-01.json +186 -1
- data/apis/DirectConnect-2012-10-25.json +758 -140
- data/apis/DynamoDB-2012-08-10.json +860 -2
- data/apis/EC2-2013-10-15.json +14698 -0
- data/apis/EMR-2009-03-31.json +86 -0
- data/apis/ElastiCache-2013-06-15.json +13 -5
- data/apis/ElasticBeanstalk-2010-12-01.json +141 -16
- data/apis/ElasticLoadBalancing-2012-06-01.json +0 -72
- data/apis/IAM-2010-05-08.json +156 -0
- data/apis/Kinesis-2013-12-02.json +9 -1
- data/apis/OpsWorks-2013-02-18.json +180 -6
- data/apis/RDS-2013-02-12.json +2 -1
- data/apis/RDS-2013-09-09.json +7963 -0
- data/apis/Redshift-2012-12-01.json +3273 -702
- data/apis/Route53-2012-12-12.json +2 -2
- data/apis/S3-2006-03-01.json +579 -538
- data/apis/SNS-2010-03-31.json +14 -0
- data/apis/SQS-2012-11-05.json +43 -6
- data/apis/STS-2011-06-15.json +81 -0
- data/apis/StorageGateway-2013-06-30.json +28 -28
- data/apis/source/cloudformation-2010-05-15.json +199 -199
- data/apis/source/cloudfront-2013-11-11.json +8828 -0
- data/apis/source/cloudfront-2013-11-11.paginators.json +32 -0
- data/apis/source/cloudfront-2013-11-11.waiters.json +29 -0
- data/apis/source/cloudsearch-2011-02-01.json +16 -23
- data/apis/source/datapipeline-2012-10-29.paginators.json +3 -2
- data/apis/source/directconnect-2012-10-25.json +1302 -363
- data/apis/source/dynamodb-2011-12-05.paginators.json +4 -1
- data/apis/source/dynamodb-2011-12-05.waiters.json +27 -0
- data/apis/source/dynamodb-2012-08-10.json +1634 -417
- data/apis/source/dynamodb-2012-08-10.paginators.json +4 -1
- data/apis/source/dynamodb-2012-08-10.waiters.json +25 -0
- data/apis/source/ec2-2013-10-15.json +19911 -0
- data/apis/source/ec2-2013-10-15.paginators.json +126 -0
- data/apis/source/ec2-2013-10-15.waiters.json +146 -0
- data/apis/source/elasticache-2013-06-15.json +10 -8
- data/apis/source/elasticache-2013-06-15.paginators.json +8 -2
- data/apis/source/elasticbeanstalk-2010-12-01.json +186 -32
- data/apis/source/elasticloadbalancing-2012-06-01.json +166 -293
- data/apis/source/elasticmapreduce-2009-03-31.json +229 -134
- data/apis/source/elastictranscoder-2012-09-25.json +1 -1
- data/apis/source/glacier-2012-06-01.paginators.json +3 -3
- data/apis/source/glacier-2012-06-01.waiters.json +23 -0
- data/apis/source/iam-2010-05-08.json +1306 -626
- data/apis/source/iam-2010-05-08.paginators.json +3 -0
- data/apis/source/kinesis-2013-12-02.json +4 -4
- data/apis/source/kinesis-2013-12-02.paginators.json +10 -4
- data/apis/source/monitoring-2010-08-01.json +336 -28
- data/apis/source/opsworks-2013-02-18.json +385 -102
- data/apis/source/rds-2013-01-10.paginators.json +6 -2
- data/apis/source/rds-2013-02-12.paginators.json +6 -2
- data/apis/source/rds-2013-09-09.json +10658 -0
- data/apis/source/rds-2013-09-09.paginators.json +110 -0
- data/apis/source/rds-2013-09-09.waiters.json +36 -0
- data/apis/source/redshift-2012-12-01.json +4759 -1237
- data/apis/source/redshift-2012-12-01.paginators.json +20 -1
- data/apis/source/redshift-2012-12-01.waiters.json +43 -0
- data/apis/source/route53-2012-12-12.paginators.json +2 -2
- data/apis/source/s3-2006-03-01.json +1032 -985
- data/apis/source/s3-2006-03-01.paginators.json +14 -3
- data/apis/source/s3-2006-03-01.waiters.json +27 -0
- data/apis/source/sns-2010-03-31.paginators.json +10 -0
- data/apis/source/sqs-2012-11-05.json +153 -101
- data/apis/source/storagegateway-2013-06-30.json +403 -442
- data/apis/source/storagegateway-2013-06-30.paginators.json +24 -0
- data/apis/source/sts-2011-06-15.json +258 -75
- data/apis/source/support-2013-04-15.paginators.json +0 -6
- data/apis/source/swf-2012-01-25.paginators.json +7 -7
- data/features/autoscaling/client.feature +6 -10
- data/features/autoscaling/{setup.rb → step_definitions.rb} +1 -1
- data/features/cloudformation/client.feature +5 -6
- data/features/cloudformation/{setup.rb → step_definitions.rb} +1 -1
- data/features/cloudfront/client.feature +5 -9
- data/features/cloudfront/{setup.rb → step_definitions.rb} +1 -1
- data/features/cloudsearch/client.feature +4 -6
- data/features/cloudsearch/{setup.rb → step_definitions.rb} +1 -1
- data/features/cloudwatch/client.feature +7 -9
- data/features/cloudwatch/{setup.rb → step_definitions.rb} +1 -1
- data/features/datapipeline/client.feature +5 -7
- data/features/datapipeline/{setup.rb → step_definitions.rb} +1 -1
- data/features/directconnect/client.feature +5 -7
- data/features/directconnect/{setup.rb → step_definitions.rb} +1 -1
- data/features/dynamodb/client.feature +6 -10
- data/features/dynamodb/simplified.feature +5 -9
- data/features/dynamodb/step_definitions.rb +9 -1
- data/features/ec2/client.feature +4 -9
- data/features/ec2/step_definitions.rb +3 -16
- data/features/elasticache/client.feature +4 -6
- data/features/elasticache/{setup.rb → step_definitions.rb} +1 -1
- data/features/elasticbeanstalk/client.feature +4 -6
- data/features/elasticbeanstalk/{setup.rb → step_definitions.rb} +1 -1
- data/features/elasticloadbalancing/client.feature +4 -6
- data/features/elasticloadbalancing/{setup.rb → step_definitions.rb} +1 -1
- data/features/elastictranscoder/client.feature +4 -6
- data/features/elastictranscoder/{setup.rb → step_definitions.rb} +1 -1
- data/features/emr/client.feature +4 -6
- data/features/emr/{setup.rb → step_definitions.rb} +1 -1
- data/features/env.rb +0 -2
- data/features/glacier/client.feature +10 -34
- data/features/glacier/step_definitions.rb +25 -8
- data/features/glacier/upload.feature +27 -0
- data/features/iam/client.feature +4 -6
- data/features/iam/{setup.rb → step_definitions.rb} +1 -1
- data/features/importexport/client.feature +4 -6
- data/features/importexport/{setup.rb → step_definitions.rb} +1 -1
- data/features/kinesis/client.feature +4 -6
- data/features/kinesis/{setup.rb → step_definitions.rb} +1 -1
- data/features/opsworks/client.feature +4 -6
- data/features/opsworks/{setup.rb → step_definitions.rb} +1 -1
- data/features/rds/client.feature +4 -6
- data/features/rds/{setup.rb → step_definitions.rb} +1 -1
- data/features/redshift/client.feature +4 -6
- data/features/redshift/{setup.rb → step_definitions.rb} +1 -1
- data/features/route53/client.feature +4 -6
- data/features/route53/{setup.rb → step_definitions.rb} +1 -1
- data/features/s3/buckets.feature +8 -0
- data/features/s3/step_definitions.rb +42 -3
- data/features/sdb/client.feature +4 -6
- data/features/sdb/{setup.rb → step_definitions.rb} +1 -1
- data/features/ses/client.feature +4 -6
- data/features/ses/{setup.rb → step_definitions.rb} +1 -1
- data/features/sns/client.feature +5 -6
- data/features/sns/{setup.rb → step_definitions.rb} +1 -1
- data/features/sqs/client.feature +5 -7
- data/features/sqs/step_definitions.rb +11 -0
- data/features/step_definitions.rb +88 -0
- data/features/storagegateway/client.feature +4 -6
- data/features/storagegateway/{setup.rb → step_definitions.rb} +1 -1
- data/features/sts/client.feature +5 -6
- data/features/sts/{setup.rb → step_definitions.rb} +1 -1
- data/features/swf/client.feature +5 -9
- data/features/swf/{setup.rb → step_definitions.rb} +1 -1
- data/lib/aws/api/shape_translator.rb +1 -0
- data/lib/aws/errors.rb +35 -11
- data/lib/aws/plugins/credentials.rb +11 -5
- data/lib/aws/plugins/regional_endpoint.rb +7 -3
- data/lib/aws/plugins/s3_regional_endpoint.rb +0 -2
- data/lib/aws/request_handler.rb +8 -3
- data/lib/aws/signers/s3.rb +14 -18
- data/lib/aws/version.rb +1 -1
- data/spec/aws/errors_spec.rb +39 -0
- data/spec/aws/plugins/credentials_spec.rb +12 -0
- data/spec/aws/plugins/region_endpoint_spec.rb +16 -4
- data/spec/aws/plugins/retry_errors_spec.rb +26 -26
- data/spec/aws/service_spec.rb +1 -1
- data/spec/fixtures/operations/route53/change_resource_record_sets.yml +18 -0
- data/tasks/test.rake +6 -18
- data/vendor/seahorse/lib/seahorse/client/http/headers.rb +20 -0
- data/vendor/seahorse/tasks/test.rake +2 -15
- metadata +77 -64
- data/features/common/step_definitions.rb +0 -63
- data/features/dynamodb/setup.rb +0 -8
- data/features/ec2/setup.rb +0 -6
- data/features/glacier/setup.rb +0 -16
- data/features/s3/setup.rb +0 -17
- data/features/sqs/setup.rb +0 -10
data/features/sdb/client.feature
CHANGED
@@ -3,14 +3,12 @@
|
|
3
3
|
Feature: Amazon SimpleDB
|
4
4
|
|
5
5
|
Scenario: Making a basic request
|
6
|
-
When I call "
|
7
|
-
Then the response
|
6
|
+
When I call the "ListDomains" API
|
7
|
+
Then the response should contain a list of "DomainNames"
|
8
8
|
|
9
9
|
Scenario: Error handling
|
10
|
-
|
11
|
-
|
12
|
-
{ domain_name: 'fake-domain' }
|
13
|
-
"""
|
10
|
+
When I attempt to call the "DomainMetadata" API with:
|
11
|
+
| DomainName | fake-domain |
|
14
12
|
Then I expect the response error code to be "NoSuchDomain"
|
15
13
|
And I expect the response error message to include:
|
16
14
|
"""
|
data/features/ses/client.feature
CHANGED
@@ -3,14 +3,12 @@
|
|
3
3
|
Feature: Amazon Simple Email Service
|
4
4
|
|
5
5
|
Scenario: Making a basic request
|
6
|
-
When I call "
|
7
|
-
Then the response
|
6
|
+
When I call the "ListIdentities" API
|
7
|
+
Then the response should contain a list of "Identities"
|
8
8
|
|
9
9
|
Scenario: Error handling
|
10
|
-
|
11
|
-
|
12
|
-
{ email_address: 'fake_email' }
|
13
|
-
"""
|
10
|
+
When I attempt to call the "VerifyEmailIdentity" API with:
|
11
|
+
| EmailAddress | fake_email |
|
14
12
|
Then I expect the response error code to be "InvalidParameterValue"
|
15
13
|
And I expect the response error message to include:
|
16
14
|
"""
|
data/features/sns/client.feature
CHANGED
@@ -3,14 +3,13 @@
|
|
3
3
|
Feature: Amazon Simple Notification Service
|
4
4
|
|
5
5
|
Scenario: Making a basic request
|
6
|
-
When I call "
|
7
|
-
Then the response
|
6
|
+
When I call the "ListTopics" API
|
7
|
+
Then the response should contain a list of "Topics"
|
8
8
|
|
9
9
|
Scenario: Error handling
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
"""
|
10
|
+
When I attempt to call the "Publish" API with:
|
11
|
+
| Message | hello |
|
12
|
+
| TopicArn | fake_topic |
|
14
13
|
Then I expect the response error code to be "InvalidParameter"
|
15
14
|
And I expect the response error message to include:
|
16
15
|
"""
|
data/features/sqs/client.feature
CHANGED
@@ -3,19 +3,17 @@
|
|
3
3
|
Feature: Amazon Simple Queue Service
|
4
4
|
|
5
5
|
Scenario: Making a basic request
|
6
|
-
When I call "
|
7
|
-
Then the response
|
6
|
+
When I call the "ListQueues" API
|
7
|
+
Then the response should contain a list of "QueueUrls"
|
8
8
|
|
9
9
|
Scenario: Cross Region Queue Operatoins
|
10
10
|
Given I create a queue in "us-west-1"
|
11
|
-
When I operate on that queue in "us-
|
11
|
+
When I operate on that queue in "us-east-1"
|
12
12
|
Then the request should be made against "us-west-1"
|
13
13
|
|
14
14
|
Scenario: Error handling
|
15
|
-
|
16
|
-
|
17
|
-
{ queue_name: 'fake_queue' }
|
18
|
-
"""
|
15
|
+
When I attempt to call the "GetQueueUrl" API with:
|
16
|
+
| QueueName | fake_queue |
|
19
17
|
Then I expect the response error code to be "NonExistentQueue"
|
20
18
|
And I expect the response error message to include:
|
21
19
|
"""
|
@@ -1,3 +1,14 @@
|
|
1
|
+
Before("@sqs") do
|
2
|
+
@sqs = @client = Aws.sqs
|
3
|
+
@sqs_created_queues = []
|
4
|
+
end
|
5
|
+
|
6
|
+
After("@sqs") do
|
7
|
+
@sqs_created_queues.each do |url|
|
8
|
+
@sqs.delete_delete_queue(queue_url: url)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
1
12
|
Given(/^I create a queue in "(.*?)"$/) do |region|
|
2
13
|
name = "aws-sdk-core-integration-test-#{Time.now.to_i}-#{rand(1000)}"
|
3
14
|
resp = Aws.sqs(region: region).create_queue(queue_name: name)
|
@@ -0,0 +1,88 @@
|
|
1
|
+
def eventually(seconds = 15, &block)
|
2
|
+
delays = [1]
|
3
|
+
while delays.inject(0) { |sum, i| sum + i } < seconds
|
4
|
+
delays << delays.last * 1.2
|
5
|
+
end
|
6
|
+
begin
|
7
|
+
yield
|
8
|
+
rescue StandardError, RSpec::Expectations::ExpectationNotMetError => error
|
9
|
+
unless delays.empty?
|
10
|
+
sleep(delays.shift)
|
11
|
+
retry
|
12
|
+
end
|
13
|
+
raise error # terminal case
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def underscore(str)
|
18
|
+
Aws::Util.underscore(str)
|
19
|
+
end
|
20
|
+
|
21
|
+
def symbolized_params(table)
|
22
|
+
table.rows_hash.each_with_object({}) do |(key,value), hash|
|
23
|
+
hash[underscore(key).to_sym] = param_value(value)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def raw_params(table)
|
28
|
+
table.rows_hash.each_with_object({}) do |(key,value), hash|
|
29
|
+
hash[key] = param_value(value)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def param_value(value)
|
34
|
+
case value
|
35
|
+
when /^\d+$/ then value.to_i
|
36
|
+
when /^\[(.*)\]$/ then $1.split(',').map { |str| str[1..-2] }
|
37
|
+
else value
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
When(/^I call the "(.*?)" API$/) do |api|
|
42
|
+
@response = @client.send(underscore(api))
|
43
|
+
end
|
44
|
+
|
45
|
+
When(/^I (attempt to )?call the "(.*?)" API with:$/) do |_, api, params|
|
46
|
+
params = @raw_json ? raw_params(params) : symbolized_params(params)
|
47
|
+
begin
|
48
|
+
@response = @client.send(underscore(api), params)
|
49
|
+
rescue => @error
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
Then(/^the response should contain a (list of )?"(\w+?)"$/) do |_,member_name|
|
54
|
+
data = @response.data
|
55
|
+
data = data[underscore(member_name)]
|
56
|
+
expect(data).to be_an(Array)
|
57
|
+
end
|
58
|
+
|
59
|
+
Then(/^the response should contain a "(\w+?)" with a list of "(\w+?)"$/) do |member1, member2|
|
60
|
+
data = @response.data
|
61
|
+
data = data[underscore(member1)]
|
62
|
+
data = data[underscore(member2)]
|
63
|
+
expect(data).to be_an(Array)
|
64
|
+
end
|
65
|
+
|
66
|
+
Then(/^I expect the response error code to be "(.*?)"$/) do |error_code|
|
67
|
+
expect(@error.class.name.split('::').last).to eq(error_code)
|
68
|
+
end
|
69
|
+
|
70
|
+
Then(/^I expect the response error message to include:$/) do |error_message|
|
71
|
+
expect(@error.message).to include(error_message)
|
72
|
+
end
|
73
|
+
|
74
|
+
Then(/^the HTTP request body should be:$/) do |string|
|
75
|
+
expect(@response.context.http_request.body_contents).to eq(string)
|
76
|
+
end
|
77
|
+
|
78
|
+
Then(/^I expect response data to be a hash$/) do
|
79
|
+
expect(@response.data).to be_a(Hash)
|
80
|
+
end
|
81
|
+
|
82
|
+
Then(/^I expect response data\["(.*?)"\] to be an array$/) do |key|
|
83
|
+
expect(@response.data[key]).to be_an(Array)
|
84
|
+
end
|
85
|
+
|
86
|
+
Then(/^the response should contain a "(.*?)" member$/) do |member_name|
|
87
|
+
expect(@response.data[underscore(member_name)]).not_to be_nil
|
88
|
+
end
|
@@ -3,14 +3,12 @@
|
|
3
3
|
Feature: AWS Storage Gateway
|
4
4
|
|
5
5
|
Scenario: Making a basic request
|
6
|
-
When I call "
|
7
|
-
Then the response
|
6
|
+
When I call the "ListGateways" API
|
7
|
+
Then the response should contain a list of "Gateways"
|
8
8
|
|
9
9
|
Scenario: Error handling
|
10
|
-
|
11
|
-
|
12
|
-
{ gateway_arn: 'fake_gateway' }
|
13
|
-
"""
|
10
|
+
When I attempt to call the "ListVolumes" API with:
|
11
|
+
| GatewayARN | fake_gateway |
|
14
12
|
Then I expect the response error code to be "ValidationException"
|
15
13
|
And I expect the response error message to include:
|
16
14
|
"""
|
data/features/sts/client.feature
CHANGED
@@ -3,14 +3,13 @@
|
|
3
3
|
Feature: AWS STS
|
4
4
|
|
5
5
|
Scenario: Making a basic request
|
6
|
-
When I call "
|
7
|
-
Then the response
|
6
|
+
When I call the "GetSessionToken" API
|
7
|
+
Then the response should contain a "Credentials" member
|
8
8
|
|
9
9
|
Scenario: Error handling
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
"""
|
10
|
+
When I attempt to call the "GetFederationToken" API with:
|
11
|
+
| Name | temp |
|
12
|
+
| Policy | |
|
14
13
|
Then I expect the response error code to be "ValidationError"
|
15
14
|
And I expect the response error message to include:
|
16
15
|
"""
|
data/features/swf/client.feature
CHANGED
@@ -3,17 +3,13 @@
|
|
3
3
|
Feature: Amazon Simple Workflow Service
|
4
4
|
|
5
5
|
Scenario: Making a basic request
|
6
|
-
When I call "
|
7
|
-
|
8
|
-
|
9
|
-
"""
|
10
|
-
Then the response "domain_infos" should be an array
|
6
|
+
When I call the "ListDomains" API with:
|
7
|
+
| RegistrationStatus | REGISTERED |
|
8
|
+
Then the response should contain a list of "DomainInfos"
|
11
9
|
|
12
10
|
Scenario: Error handling
|
13
|
-
|
14
|
-
|
15
|
-
{ name: 'fake_domain' }
|
16
|
-
"""
|
11
|
+
When I attempt to call the "DescribeDomain" API with:
|
12
|
+
| Name | fake_domain |
|
17
13
|
Then I expect the response error code to be "UnknownResourceFault"
|
18
14
|
And I expect the response error message to include:
|
19
15
|
"""
|
data/lib/aws/errors.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'thread'
|
2
|
+
|
1
3
|
module Aws
|
2
4
|
module Errors
|
3
5
|
|
@@ -9,12 +11,8 @@ module Aws
|
|
9
11
|
|
10
12
|
# @param [Seahorse::Client::RequestContext] context
|
11
13
|
# @param [String] message
|
12
|
-
def initialize(context
|
13
|
-
|
14
|
-
message = context
|
15
|
-
else
|
16
|
-
@context = context
|
17
|
-
end
|
14
|
+
def initialize(context, message)
|
15
|
+
@context = context
|
18
16
|
super(message)
|
19
17
|
end
|
20
18
|
|
@@ -53,8 +51,12 @@ module Aws
|
|
53
51
|
# @api private
|
54
52
|
module DynamicErrors
|
55
53
|
|
54
|
+
def self.extended(submodule)
|
55
|
+
submodule.instance_variable_set("@const_set_mutex", Mutex.new)
|
56
|
+
end
|
57
|
+
|
56
58
|
def const_missing(constant)
|
57
|
-
|
59
|
+
set_error_constant(constant)
|
58
60
|
end
|
59
61
|
|
60
62
|
# Given the name of a service and an error code, this method
|
@@ -64,14 +66,36 @@ module Aws
|
|
64
66
|
# #=> #<Aws::S3::Errors::NoSuchBucket>
|
65
67
|
#
|
66
68
|
# @api private
|
67
|
-
def error_class(
|
68
|
-
|
69
|
-
|
69
|
+
def error_class(error_code)
|
70
|
+
constant = error_code.to_s
|
71
|
+
constant = constant.gsub(/http:\/\/.*$/, '') # remove http namespaces
|
72
|
+
constant = constant.gsub(/[^a-zA-Z0-9]/, '').to_sym
|
73
|
+
if error_const_set?(constant)
|
74
|
+
const_get(constant)
|
70
75
|
else
|
71
|
-
|
76
|
+
set_error_constant(constant)
|
72
77
|
end
|
73
78
|
end
|
74
79
|
|
80
|
+
private
|
81
|
+
|
82
|
+
def set_error_constant(constant)
|
83
|
+
@const_set_mutex.synchronize do
|
84
|
+
# Ensure the const was not defined while blocked by the mutex
|
85
|
+
if error_const_set?(constant)
|
86
|
+
const_get(constant)
|
87
|
+
else
|
88
|
+
const_set(constant , Class.new(ServiceError))
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
def error_const_set?(constant)
|
94
|
+
# Purposefully not using #const_defined? as that method returns true
|
95
|
+
# for constants not defined directly in the current module.
|
96
|
+
constants.include?(constant.to_sym)
|
97
|
+
end
|
98
|
+
|
75
99
|
end
|
76
100
|
end
|
77
101
|
end
|
@@ -2,14 +2,17 @@ module Aws
|
|
2
2
|
module Plugins
|
3
3
|
|
4
4
|
# @seahorse.client.option [String] :access_key_id Your AWS account
|
5
|
-
# access key ID. Defaults to `ENV['
|
5
|
+
# access key ID. Defaults to `ENV['AWS_ACCESS_KEY']`.
|
6
|
+
# Also checks `AWS_ACCESS_KEY_ID` and `AMAZON_ACCESS_KEY_ID`.
|
6
7
|
#
|
7
8
|
# @seahorse.client.option [String] :secret_access_key Your AWS account
|
8
|
-
# secret access key. Defaults to `ENV['
|
9
|
+
# secret access key. Defaults to `ENV['AWS_SECRET_KEY']`.
|
10
|
+
# Also checks `AWS_SECRET_ACCESS_KEY` and `AMAZON_SECRET_ACCESS_KEY`.
|
9
11
|
#
|
10
12
|
# @seahorse.client.option [String] :session_token If your credentials
|
11
13
|
# are temporary session credentials, this should be the
|
12
14
|
# session token. Defaults to `ENV['AWS_SESSION_TOKEN']`.
|
15
|
+
# Also checks `AMAZON_SESSION_TOKEN`.
|
13
16
|
#
|
14
17
|
# @seahorse.client.option [Credentials] :credentials
|
15
18
|
# Your AWS account credentials. Defaults to a new {Credentials} object
|
@@ -19,15 +22,18 @@ module Aws
|
|
19
22
|
class Credentials < Seahorse::Client::Plugin
|
20
23
|
|
21
24
|
option(:access_key_id) {
|
22
|
-
|
25
|
+
keys = %w(AWS_ACCESS_KEY AWS_ACCESS_KEY_ID AMAZON_ACCESS_KEY_ID)
|
26
|
+
ENV.values_at(*keys).compact.first
|
23
27
|
}
|
24
28
|
|
25
29
|
option(:secret_access_key) {
|
26
|
-
|
30
|
+
keys = %w(AWS_SECRET_KEY AWS_SECRET_ACCESS_KEY AMAZON_SECRET_ACCESS_KEY)
|
31
|
+
ENV.values_at(*keys).compact.first
|
27
32
|
}
|
28
33
|
|
29
34
|
option(:session_token) {
|
30
|
-
|
35
|
+
keys = %w(AWS_SESSION_TOKEN AMAZON_SESSION_TOKEN)
|
36
|
+
ENV.values_at(*keys).compact.first
|
31
37
|
}
|
32
38
|
|
33
39
|
option(:credentials) do |config|
|
@@ -1,9 +1,10 @@
|
|
1
1
|
module Aws
|
2
2
|
module Plugins
|
3
3
|
|
4
|
-
# @seahorse.client.option [String] :region
|
4
|
+
# @seahorse.client.option [String] :region
|
5
5
|
# The AWS region to connect to. The region is used to construct
|
6
|
-
# the client endpoint.
|
6
|
+
# the client endpoint. Defaults to `ENV['AWS_DEFAULT_REGION']`.
|
7
|
+
# Also checks `AWS_REGION` and `AMAZON_REGION`.
|
7
8
|
#
|
8
9
|
# @seahorse.client.option [String] :endpoint
|
9
10
|
# The HTTP endpoint for this client. Normally you should not need
|
@@ -17,7 +18,10 @@ module Aws
|
|
17
18
|
# raised when region is not configured
|
18
19
|
MISSING_REGION = 'missing required configuration option :region'
|
19
20
|
|
20
|
-
option(:region) {
|
21
|
+
option(:region) {
|
22
|
+
keys = %w(AWS_DEFAULT_REGION AWS_REGION AMAZON_REGION)
|
23
|
+
ENV.values_at(*keys).compact.first
|
24
|
+
}
|
21
25
|
|
22
26
|
option(:endpoint) do |cfg|
|
23
27
|
endpoints = cfg.api.metadata['regional_endpoints']
|