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.
Files changed (158) hide show
  1. checksums.yaml +4 -4
  2. data/apis/CloudFront-2013-11-11.json +5502 -0
  3. data/apis/CloudWatch-2010-08-01.json +186 -1
  4. data/apis/DirectConnect-2012-10-25.json +758 -140
  5. data/apis/DynamoDB-2012-08-10.json +860 -2
  6. data/apis/EC2-2013-10-15.json +14698 -0
  7. data/apis/EMR-2009-03-31.json +86 -0
  8. data/apis/ElastiCache-2013-06-15.json +13 -5
  9. data/apis/ElasticBeanstalk-2010-12-01.json +141 -16
  10. data/apis/ElasticLoadBalancing-2012-06-01.json +0 -72
  11. data/apis/IAM-2010-05-08.json +156 -0
  12. data/apis/Kinesis-2013-12-02.json +9 -1
  13. data/apis/OpsWorks-2013-02-18.json +180 -6
  14. data/apis/RDS-2013-02-12.json +2 -1
  15. data/apis/RDS-2013-09-09.json +7963 -0
  16. data/apis/Redshift-2012-12-01.json +3273 -702
  17. data/apis/Route53-2012-12-12.json +2 -2
  18. data/apis/S3-2006-03-01.json +579 -538
  19. data/apis/SNS-2010-03-31.json +14 -0
  20. data/apis/SQS-2012-11-05.json +43 -6
  21. data/apis/STS-2011-06-15.json +81 -0
  22. data/apis/StorageGateway-2013-06-30.json +28 -28
  23. data/apis/source/cloudformation-2010-05-15.json +199 -199
  24. data/apis/source/cloudfront-2013-11-11.json +8828 -0
  25. data/apis/source/cloudfront-2013-11-11.paginators.json +32 -0
  26. data/apis/source/cloudfront-2013-11-11.waiters.json +29 -0
  27. data/apis/source/cloudsearch-2011-02-01.json +16 -23
  28. data/apis/source/datapipeline-2012-10-29.paginators.json +3 -2
  29. data/apis/source/directconnect-2012-10-25.json +1302 -363
  30. data/apis/source/dynamodb-2011-12-05.paginators.json +4 -1
  31. data/apis/source/dynamodb-2011-12-05.waiters.json +27 -0
  32. data/apis/source/dynamodb-2012-08-10.json +1634 -417
  33. data/apis/source/dynamodb-2012-08-10.paginators.json +4 -1
  34. data/apis/source/dynamodb-2012-08-10.waiters.json +25 -0
  35. data/apis/source/ec2-2013-10-15.json +19911 -0
  36. data/apis/source/ec2-2013-10-15.paginators.json +126 -0
  37. data/apis/source/ec2-2013-10-15.waiters.json +146 -0
  38. data/apis/source/elasticache-2013-06-15.json +10 -8
  39. data/apis/source/elasticache-2013-06-15.paginators.json +8 -2
  40. data/apis/source/elasticbeanstalk-2010-12-01.json +186 -32
  41. data/apis/source/elasticloadbalancing-2012-06-01.json +166 -293
  42. data/apis/source/elasticmapreduce-2009-03-31.json +229 -134
  43. data/apis/source/elastictranscoder-2012-09-25.json +1 -1
  44. data/apis/source/glacier-2012-06-01.paginators.json +3 -3
  45. data/apis/source/glacier-2012-06-01.waiters.json +23 -0
  46. data/apis/source/iam-2010-05-08.json +1306 -626
  47. data/apis/source/iam-2010-05-08.paginators.json +3 -0
  48. data/apis/source/kinesis-2013-12-02.json +4 -4
  49. data/apis/source/kinesis-2013-12-02.paginators.json +10 -4
  50. data/apis/source/monitoring-2010-08-01.json +336 -28
  51. data/apis/source/opsworks-2013-02-18.json +385 -102
  52. data/apis/source/rds-2013-01-10.paginators.json +6 -2
  53. data/apis/source/rds-2013-02-12.paginators.json +6 -2
  54. data/apis/source/rds-2013-09-09.json +10658 -0
  55. data/apis/source/rds-2013-09-09.paginators.json +110 -0
  56. data/apis/source/rds-2013-09-09.waiters.json +36 -0
  57. data/apis/source/redshift-2012-12-01.json +4759 -1237
  58. data/apis/source/redshift-2012-12-01.paginators.json +20 -1
  59. data/apis/source/redshift-2012-12-01.waiters.json +43 -0
  60. data/apis/source/route53-2012-12-12.paginators.json +2 -2
  61. data/apis/source/s3-2006-03-01.json +1032 -985
  62. data/apis/source/s3-2006-03-01.paginators.json +14 -3
  63. data/apis/source/s3-2006-03-01.waiters.json +27 -0
  64. data/apis/source/sns-2010-03-31.paginators.json +10 -0
  65. data/apis/source/sqs-2012-11-05.json +153 -101
  66. data/apis/source/storagegateway-2013-06-30.json +403 -442
  67. data/apis/source/storagegateway-2013-06-30.paginators.json +24 -0
  68. data/apis/source/sts-2011-06-15.json +258 -75
  69. data/apis/source/support-2013-04-15.paginators.json +0 -6
  70. data/apis/source/swf-2012-01-25.paginators.json +7 -7
  71. data/features/autoscaling/client.feature +6 -10
  72. data/features/autoscaling/{setup.rb → step_definitions.rb} +1 -1
  73. data/features/cloudformation/client.feature +5 -6
  74. data/features/cloudformation/{setup.rb → step_definitions.rb} +1 -1
  75. data/features/cloudfront/client.feature +5 -9
  76. data/features/cloudfront/{setup.rb → step_definitions.rb} +1 -1
  77. data/features/cloudsearch/client.feature +4 -6
  78. data/features/cloudsearch/{setup.rb → step_definitions.rb} +1 -1
  79. data/features/cloudwatch/client.feature +7 -9
  80. data/features/cloudwatch/{setup.rb → step_definitions.rb} +1 -1
  81. data/features/datapipeline/client.feature +5 -7
  82. data/features/datapipeline/{setup.rb → step_definitions.rb} +1 -1
  83. data/features/directconnect/client.feature +5 -7
  84. data/features/directconnect/{setup.rb → step_definitions.rb} +1 -1
  85. data/features/dynamodb/client.feature +6 -10
  86. data/features/dynamodb/simplified.feature +5 -9
  87. data/features/dynamodb/step_definitions.rb +9 -1
  88. data/features/ec2/client.feature +4 -9
  89. data/features/ec2/step_definitions.rb +3 -16
  90. data/features/elasticache/client.feature +4 -6
  91. data/features/elasticache/{setup.rb → step_definitions.rb} +1 -1
  92. data/features/elasticbeanstalk/client.feature +4 -6
  93. data/features/elasticbeanstalk/{setup.rb → step_definitions.rb} +1 -1
  94. data/features/elasticloadbalancing/client.feature +4 -6
  95. data/features/elasticloadbalancing/{setup.rb → step_definitions.rb} +1 -1
  96. data/features/elastictranscoder/client.feature +4 -6
  97. data/features/elastictranscoder/{setup.rb → step_definitions.rb} +1 -1
  98. data/features/emr/client.feature +4 -6
  99. data/features/emr/{setup.rb → step_definitions.rb} +1 -1
  100. data/features/env.rb +0 -2
  101. data/features/glacier/client.feature +10 -34
  102. data/features/glacier/step_definitions.rb +25 -8
  103. data/features/glacier/upload.feature +27 -0
  104. data/features/iam/client.feature +4 -6
  105. data/features/iam/{setup.rb → step_definitions.rb} +1 -1
  106. data/features/importexport/client.feature +4 -6
  107. data/features/importexport/{setup.rb → step_definitions.rb} +1 -1
  108. data/features/kinesis/client.feature +4 -6
  109. data/features/kinesis/{setup.rb → step_definitions.rb} +1 -1
  110. data/features/opsworks/client.feature +4 -6
  111. data/features/opsworks/{setup.rb → step_definitions.rb} +1 -1
  112. data/features/rds/client.feature +4 -6
  113. data/features/rds/{setup.rb → step_definitions.rb} +1 -1
  114. data/features/redshift/client.feature +4 -6
  115. data/features/redshift/{setup.rb → step_definitions.rb} +1 -1
  116. data/features/route53/client.feature +4 -6
  117. data/features/route53/{setup.rb → step_definitions.rb} +1 -1
  118. data/features/s3/buckets.feature +8 -0
  119. data/features/s3/step_definitions.rb +42 -3
  120. data/features/sdb/client.feature +4 -6
  121. data/features/sdb/{setup.rb → step_definitions.rb} +1 -1
  122. data/features/ses/client.feature +4 -6
  123. data/features/ses/{setup.rb → step_definitions.rb} +1 -1
  124. data/features/sns/client.feature +5 -6
  125. data/features/sns/{setup.rb → step_definitions.rb} +1 -1
  126. data/features/sqs/client.feature +5 -7
  127. data/features/sqs/step_definitions.rb +11 -0
  128. data/features/step_definitions.rb +88 -0
  129. data/features/storagegateway/client.feature +4 -6
  130. data/features/storagegateway/{setup.rb → step_definitions.rb} +1 -1
  131. data/features/sts/client.feature +5 -6
  132. data/features/sts/{setup.rb → step_definitions.rb} +1 -1
  133. data/features/swf/client.feature +5 -9
  134. data/features/swf/{setup.rb → step_definitions.rb} +1 -1
  135. data/lib/aws/api/shape_translator.rb +1 -0
  136. data/lib/aws/errors.rb +35 -11
  137. data/lib/aws/plugins/credentials.rb +11 -5
  138. data/lib/aws/plugins/regional_endpoint.rb +7 -3
  139. data/lib/aws/plugins/s3_regional_endpoint.rb +0 -2
  140. data/lib/aws/request_handler.rb +8 -3
  141. data/lib/aws/signers/s3.rb +14 -18
  142. data/lib/aws/version.rb +1 -1
  143. data/spec/aws/errors_spec.rb +39 -0
  144. data/spec/aws/plugins/credentials_spec.rb +12 -0
  145. data/spec/aws/plugins/region_endpoint_spec.rb +16 -4
  146. data/spec/aws/plugins/retry_errors_spec.rb +26 -26
  147. data/spec/aws/service_spec.rb +1 -1
  148. data/spec/fixtures/operations/route53/change_resource_record_sets.yml +18 -0
  149. data/tasks/test.rake +6 -18
  150. data/vendor/seahorse/lib/seahorse/client/http/headers.rb +20 -0
  151. data/vendor/seahorse/tasks/test.rake +2 -15
  152. metadata +77 -64
  153. data/features/common/step_definitions.rb +0 -63
  154. data/features/dynamodb/setup.rb +0 -8
  155. data/features/ec2/setup.rb +0 -6
  156. data/features/glacier/setup.rb +0 -16
  157. data/features/s3/setup.rb +0 -17
  158. data/features/sqs/setup.rb +0 -10
@@ -3,14 +3,12 @@
3
3
  Feature: Amazon SimpleDB
4
4
 
5
5
  Scenario: Making a basic request
6
- When I call "list_domains" on "sdb"
7
- Then the response "domain_names" should be an array
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
- Given I call "domain_metadata" on "sdb" with:
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
  """
@@ -1,5 +1,5 @@
1
1
  Before("@sdb") do
2
- @sdb = Aws.sdb
2
+ @sdb = @client = Aws.sdb
3
3
  end
4
4
 
5
5
  After("@sdb") do
@@ -3,14 +3,12 @@
3
3
  Feature: Amazon Simple Email Service
4
4
 
5
5
  Scenario: Making a basic request
6
- When I call "list_identities" on "ses"
7
- Then the response "identities" should be an array
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
- Given I call "verify_email_identity" on "ses" with:
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
  """
@@ -1,5 +1,5 @@
1
1
  Before("@ses") do
2
- @ses = Aws.ses
2
+ @ses = @client = Aws.ses
3
3
  end
4
4
 
5
5
  After("@ses") do
@@ -3,14 +3,13 @@
3
3
  Feature: Amazon Simple Notification Service
4
4
 
5
5
  Scenario: Making a basic request
6
- When I call "list_topics" on "sns"
7
- Then the response "topics" should be an array
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
- Given I call "publish" on "sns" with:
11
- """
12
- { message: 'hello', topic_arn: 'fake_topic' }
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
  """
@@ -1,5 +1,5 @@
1
1
  Before("@sns") do
2
- @sns = Aws.sns
2
+ @sns = @client = Aws.sns
3
3
  end
4
4
 
5
5
  After("@sns") do
@@ -3,19 +3,17 @@
3
3
  Feature: Amazon Simple Queue Service
4
4
 
5
5
  Scenario: Making a basic request
6
- When I call "list_queues" on "sqs"
7
- Then the response "queue_urls" should be an array
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-west-2"
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
- Given I call "get_queue_url" on "sqs" with:
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 "list_gateways" on "storagegateway"
7
- Then the response "gateways" should be an array
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
- Given I call "list_volumes" on "storagegateway" with:
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
  """
@@ -1,5 +1,5 @@
1
1
  Before("@storagegateway") do
2
- @storagegateway = Aws.storagegateway
2
+ @storagegateway = @client = Aws.storagegateway
3
3
  end
4
4
 
5
5
  After("@storagegateway") do
@@ -3,14 +3,13 @@
3
3
  Feature: AWS STS
4
4
 
5
5
  Scenario: Making a basic request
6
- When I call "get_session_token" on "sts"
7
- Then the response data should include "credentials"
6
+ When I call the "GetSessionToken" API
7
+ Then the response should contain a "Credentials" member
8
8
 
9
9
  Scenario: Error handling
10
- Given I call "get_federation_token" on "sts" with:
11
- """
12
- { name: 'temp', policy: '' }
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
  """
@@ -1,5 +1,5 @@
1
1
  Before("@sts") do
2
- @sts = Aws.sts
2
+ @sts = @client = Aws.sts
3
3
  end
4
4
 
5
5
  After("@sts") do
@@ -3,17 +3,13 @@
3
3
  Feature: Amazon Simple Workflow Service
4
4
 
5
5
  Scenario: Making a basic request
6
- When I call "list_domains" on "swf" with:
7
- """
8
- { registration_status: 'REGISTERED' }
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
- Given I call "describe_domain" on "swf" with:
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
  """
@@ -1,5 +1,5 @@
1
1
  Before("@swf") do
2
- @swf = Aws.swf
2
+ @swf = @client = Aws.swf
3
3
  end
4
4
 
5
5
  After("@swf") do
@@ -36,6 +36,7 @@ module Aws
36
36
  ignore :member_order
37
37
  ignore :box
38
38
  ignore :streaming
39
+ ignore :sensitive
39
40
 
40
41
  # validation properties
41
42
  ignore :pattern
@@ -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 = nil, message = nil)
13
- if context.is_a?(String)
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
- const_set(constant, Class.new(ServiceError))
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(contstant)
68
- if constants.include?(contstant.to_sym)
69
- const_get(contstant)
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
- const_set(contstant, Class.new(ServiceError))
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['AWS_ACCESS_KEY_ID']`.
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['AWS_SECRET_ACCESS_KEY']`.
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
- ENV['AWS_ACCESS_KEY_ID'] || ENV['AMAZON_ACCESS_KEY_ID']
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
- ENV['AWS_SECRET_ACCESS_KEY'] || ENV['AMAZON_SECRET_ACCESS_KEY']
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
- ENV['AWS_SESSION_TOKEN'] || ENV['AMAZON_SESSION_TOKEN']
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 (ENV['AWS_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) { ENV['AWS_REGION'] || ENV['AMAZON_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']