aws-sdk 1.32.0 → 1.50.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +28 -10
- data/bin/aws-rb +11 -1
- data/endpoints.json +191 -26
- data/lib/aws/api_config/AutoScaling-2011-01-01.yml +201 -0
- data/lib/aws/api_config/CloudFormation-2010-05-15.yml +15 -1
- data/lib/aws/api_config/CloudFront-2013-11-22.yml +2918 -0
- data/lib/aws/api_config/CloudFront-2014-01-31.yml +2934 -0
- data/lib/aws/api_config/CloudFront-2014-05-31.yml +3100 -0
- data/lib/aws/api_config/CloudSearch-2013-01-01.yml +1164 -0
- data/lib/aws/api_config/CloudTrail-2013-11-01.yml +4 -33
- data/lib/aws/api_config/DynamoDB-2012-08-10.yml +101 -1
- data/lib/aws/api_config/EC2-2013-08-15.yml +2 -2
- data/lib/aws/api_config/EC2-2013-10-01.yml +2 -2
- data/lib/aws/api_config/EC2-2013-10-15.yml +3 -78
- data/lib/aws/api_config/EC2-2014-02-01.yml +4755 -0
- data/lib/aws/api_config/EC2-2014-05-01.yml +4812 -0
- data/lib/aws/api_config/ELB-2012-06-01.yml +65 -1
- data/lib/aws/api_config/EMR-2009-03-31.yml +20 -1
- data/lib/aws/api_config/ElastiCache-2014-03-24.yml +1375 -0
- data/lib/aws/api_config/ElastiCache-2014-07-15.yml +1385 -0
- data/lib/aws/api_config/ElasticBeanstalk-2010-12-01.yml +8 -1
- data/lib/aws/api_config/ElasticTranscoder-2012-09-25.yml +798 -1
- data/lib/aws/api_config/IAM-2010-05-08.yml +44 -2
- data/lib/aws/api_config/Kinesis-2013-12-02.yml +1 -1
- data/lib/aws/api_config/OpsWorks-2013-02-18.yml +201 -1
- data/lib/aws/api_config/RDS-2013-09-09.yml +1 -2
- data/lib/aws/api_config/Redshift-2012-12-01.yml +25 -1
- data/lib/aws/api_config/Route53-2013-04-01.yml +889 -0
- data/lib/aws/api_config/SNS-2010-03-31.yml +16 -1
- data/lib/aws/api_config/SQS-2012-11-05.yml +86 -1
- data/lib/aws/api_config/STS-2011-06-15.yml +5 -1
- data/lib/aws/api_config/SimpleEmailService-2010-12-01.yml +1 -1
- data/lib/aws/api_config/Support-2013-04-15.yml +63 -0
- data/lib/aws/auto_scaling/group.rb +1 -1
- data/lib/aws/cloud_formation/stack_resource_collection.rb +1 -1
- data/lib/aws/cloud_front/client.rb +13 -1
- data/lib/aws/cloud_search/client.rb +6 -2
- data/lib/aws/cloud_watch/alarm.rb +3 -0
- data/lib/aws/core.rb +16 -1
- data/lib/aws/core/client.rb +10 -1
- data/lib/aws/core/configuration.rb +3 -2
- data/lib/aws/core/credential_providers.rb +130 -12
- data/lib/aws/core/http/connection_pool.rb +23 -3
- data/lib/aws/core/http/net_http_handler.rb +18 -21
- data/lib/aws/core/http/request.rb +10 -0
- data/lib/aws/core/ini_parser.rb +42 -0
- data/lib/aws/core/lazy_error_classes.rb +20 -2
- data/lib/aws/core/log_formatter.rb +1 -1
- data/lib/aws/core/model.rb +5 -0
- data/lib/aws/core/option_grammar.rb +9 -9
- data/lib/aws/core/policy.rb +2 -3
- data/lib/aws/core/response.rb +4 -0
- data/lib/aws/core/signers/version_4.rb +1 -1
- data/lib/aws/core/signers/version_4/chunk_signed_stream.rb +1 -1
- data/lib/aws/core/xml/frame.rb +1 -0
- data/lib/aws/core/xml/grammar.rb +1 -0
- data/lib/aws/dynamo_db.rb +16 -0
- data/lib/aws/dynamo_db/batch_write.rb +2 -0
- data/lib/aws/dynamo_db/table.rb +4 -8
- data/lib/aws/ec2.rb +1 -1
- data/lib/aws/ec2/client.rb +64 -1
- data/lib/aws/ec2/image_collection.rb +1 -2
- data/lib/aws/ec2/instance.rb +3 -3
- data/lib/aws/ec2/instance_collection.rb +14 -3
- data/lib/aws/ec2/snapshot_collection.rb +1 -1
- data/lib/aws/ec2/subnet_collection.rb +7 -3
- data/lib/aws/ec2/tagged_collection.rb +14 -0
- data/lib/aws/ec2/volume_collection.rb +4 -0
- data/lib/aws/ec2/vpc.rb +8 -0
- data/lib/aws/ec2/vpc_collection.rb +1 -1
- data/lib/aws/elasticache/client.rb +8 -2
- data/lib/aws/emr/job_flow_collection.rb +4 -6
- data/lib/aws/glacier.rb +4 -4
- data/lib/aws/glacier/vault.rb +1 -1
- data/lib/aws/iam/server_certificate.rb +24 -17
- data/lib/aws/iam/signing_certificate.rb +13 -1
- data/lib/aws/rails.rb +1 -1
- data/lib/aws/rds/db_instance.rb +5 -6
- data/lib/aws/record/abstract_base.rb +0 -1
- data/lib/aws/record/hash_model.rb +1 -1
- data/lib/aws/record/model.rb +1 -1
- data/lib/aws/route_53/client.rb +5 -2
- data/lib/aws/route_53/hosted_zone.rb +39 -16
- data/lib/aws/route_53/hosted_zone_collection.rb +2 -1
- data/lib/aws/s3/bucket_lifecycle_configuration.rb +22 -6
- data/lib/aws/s3/cipher_io.rb +1 -1
- data/lib/aws/s3/client.rb +155 -7
- data/lib/aws/s3/client/xml.rb +7 -0
- data/lib/aws/s3/multipart_upload.rb +3 -1
- data/lib/aws/s3/object_collection.rb +1 -1
- data/lib/aws/s3/presign_v4.rb +13 -4
- data/lib/aws/s3/s3_object.rb +3 -0
- data/lib/aws/simple_email_service.rb +13 -0
- data/lib/aws/simple_email_service/identity.rb +21 -0
- data/lib/aws/simple_workflow/decision_task.rb +2 -2
- data/lib/aws/simple_workflow/decision_task_collection.rb +0 -2
- data/lib/aws/simple_workflow/option_formatters.rb +1 -1
- data/lib/aws/simple_workflow/workflow_execution_collection.rb +2 -2
- data/lib/aws/simple_workflow/workflow_type.rb +0 -2
- data/lib/aws/sns/message.rb +11 -1
- data/lib/aws/sns/topic.rb +1 -1
- data/lib/aws/sns/topic_collection.rb +1 -1
- data/lib/aws/sqs/queue.rb +26 -14
- data/lib/aws/sqs/queue_collection.rb +4 -0
- data/lib/aws/sqs/received_message.rb +4 -0
- data/lib/aws/sts/client.rb +9 -0
- data/lib/aws/version.rb +1 -1
- metadata +113 -117
data/lib/aws/core/model.rb
CHANGED
@@ -378,13 +378,13 @@ module AWS
|
|
378
378
|
|
379
379
|
option.extend self
|
380
380
|
|
381
|
-
key_option = option.key_option
|
381
|
+
key_option = option.key_option(members)
|
382
382
|
if key_descriptors = members[:key]
|
383
383
|
key_option = key_option.extend_with_config(*key_descriptors)
|
384
384
|
MetaUtils.extend_method(option, :key_option) { key_option }
|
385
385
|
end
|
386
386
|
|
387
|
-
value_option = option.value_option
|
387
|
+
value_option = option.value_option(members)
|
388
388
|
if value_descriptors = members[:value]
|
389
389
|
value_option = value_option.extend_with_config(*value_descriptors)
|
390
390
|
MetaUtils.extend_method(option, :value_option) { value_option }
|
@@ -416,13 +416,13 @@ module AWS
|
|
416
416
|
values.inject([]) do |params, (key,value)|
|
417
417
|
|
418
418
|
index = params.size / 2 + 1
|
419
|
-
common_prefix = "#{prefixed_name(prefix)}#{separator}#{index}
|
419
|
+
common_prefix = "#{prefixed_name(prefix)}#{separator}#{index}"
|
420
420
|
|
421
421
|
key_name = common_prefix + key_option.param_name
|
422
422
|
value_name = common_prefix + value_option.param_name
|
423
423
|
|
424
|
-
params
|
425
|
-
params
|
424
|
+
params += key_option.request_params(key, common_prefix)
|
425
|
+
params += value_option.request_params(value, common_prefix)
|
426
426
|
|
427
427
|
end
|
428
428
|
end
|
@@ -436,12 +436,12 @@ module AWS
|
|
436
436
|
end
|
437
437
|
end
|
438
438
|
|
439
|
-
def key_option
|
440
|
-
@_key_option ||= MapOption.new("key")
|
439
|
+
def key_option(options)
|
440
|
+
@_key_option ||= MapOption.new(options[:key_param] || "key")
|
441
441
|
end
|
442
442
|
|
443
|
-
def value_option
|
444
|
-
@_value_option ||= MapOption.new("value")
|
443
|
+
def value_option(options)
|
444
|
+
@_value_option ||= MapOption.new(options[:value_param] || "value")
|
445
445
|
end
|
446
446
|
|
447
447
|
end
|
data/lib/aws/core/policy.rb
CHANGED
@@ -11,7 +11,6 @@
|
|
11
11
|
# ANY KIND, either express or implied. See the License for the specific
|
12
12
|
# language governing permissions and limitations under the License.
|
13
13
|
|
14
|
-
require 'uuidtools'
|
15
14
|
require 'date'
|
16
15
|
require 'json'
|
17
16
|
|
@@ -84,7 +83,7 @@ module AWS
|
|
84
83
|
if opts.has_key?(:id) or opts.has_key?("Id")
|
85
84
|
@id = opts[:id] || opts["Id"]
|
86
85
|
else
|
87
|
-
@id =
|
86
|
+
@id = SecureRandom.uuid.tr('-','')
|
88
87
|
end
|
89
88
|
if opts.has_key?(:version) or opts.has_key?("Version")
|
90
89
|
@version = opts[:version] || opts["Version"]
|
@@ -748,7 +747,7 @@ module AWS
|
|
748
747
|
# Policy#deny to add conditions to a statement.
|
749
748
|
# @see S3::Client
|
750
749
|
def initialize(opts = {})
|
751
|
-
self.sid =
|
750
|
+
self.sid = SecureRandom.uuid.tr('-','')
|
752
751
|
self.conditions = ConditionBlock.new
|
753
752
|
|
754
753
|
parse_options(opts)
|
data/lib/aws/core/response.rb
CHANGED
@@ -70,6 +70,9 @@ module AWS
|
|
70
70
|
# returned this response.
|
71
71
|
attr_accessor :request_type
|
72
72
|
|
73
|
+
# @return [String] The API version of the request/client.
|
74
|
+
attr_accessor :api_version
|
75
|
+
|
73
76
|
# @return [Hash] Returns the hash of options passed to the client
|
74
77
|
# request method that generated this response.
|
75
78
|
attr_accessor :request_options
|
@@ -141,6 +144,7 @@ module AWS
|
|
141
144
|
# @api private
|
142
145
|
def cache_key
|
143
146
|
[
|
147
|
+
api_version,
|
144
148
|
http_request.access_key_id,
|
145
149
|
http_request.host,
|
146
150
|
request_type,
|
data/lib/aws/core/xml/frame.rb
CHANGED
@@ -231,6 +231,7 @@ module AWS
|
|
231
231
|
# that AWS uses almost (??) everywhere.
|
232
232
|
if @text.tr(*TRANSLATE_DIGITS) == EASY_FORMAT
|
233
233
|
parts = @text.tr(*DATE_PUNCTUATION).chop.split.map {|p| p.to_i }
|
234
|
+
parts[-1] = parts[-1] * 1000
|
234
235
|
klass.send(parts_constructor, *parts)
|
235
236
|
else
|
236
237
|
# fallback in case we have to handle another date format
|
data/lib/aws/core/xml/grammar.rb
CHANGED
data/lib/aws/dynamo_db.rb
CHANGED
@@ -22,6 +22,20 @@ module AWS
|
|
22
22
|
# :access_key_id => '...',
|
23
23
|
# :secret_access_key => '...')
|
24
24
|
#
|
25
|
+
# # Supported API Version
|
26
|
+
#
|
27
|
+
# Please note, the `AWS::DynamoDB` classes have been built against
|
28
|
+
# the 2011-12-05 API version. Constructing a `AWS::DynamoDB` object
|
29
|
+
# with a newer API version will emit a warning and then ignore the
|
30
|
+
# specified version.
|
31
|
+
#
|
32
|
+
# If you would like to use features of the newer 2012-08-10 API
|
33
|
+
# version, then please construct a DynamoDB client and use the
|
34
|
+
# client API directly.
|
35
|
+
#
|
36
|
+
# # supports the latest API version
|
37
|
+
# ddb = AWS::DynamoDB::Client.new(api_verison:'2012-08-10')
|
38
|
+
#
|
25
39
|
# # Tables
|
26
40
|
#
|
27
41
|
# Tables contain items, and organize information into discrete
|
@@ -124,10 +138,12 @@ module AWS
|
|
124
138
|
|
125
139
|
endpoint_prefix 'dynamodb'
|
126
140
|
|
141
|
+
IGNORING_API_SPECIFIED_MSG = "WARNING: Ignoring DynamoDB API version specified because only '2011-12-05' is supported by this class. To use another version of the API, invoke the lower level AWS::DynamoDB::Client explicitly."
|
127
142
|
|
128
143
|
def initialize options = {}
|
129
144
|
options = options.dup
|
130
145
|
options[:dynamo_db] ||= {}
|
146
|
+
warn(IGNORING_API_SPECIFIED_MSG) if options[:dynamo_db][:api_version]
|
131
147
|
options[:dynamo_db][:api_version] = '2011-12-05'
|
132
148
|
super(options)
|
133
149
|
end
|
@@ -240,8 +240,10 @@ module AWS
|
|
240
240
|
case type
|
241
241
|
when "S" then { :s => value }
|
242
242
|
when "N" then { :n => value }
|
243
|
+
when "B" then { :b => value }
|
243
244
|
when "SS" then { :ss => value }
|
244
245
|
when "NS" then { :ns => value }
|
246
|
+
when "BS" then { :bs => value }
|
245
247
|
else
|
246
248
|
raise "unhandled key type: #{type.inspect}"
|
247
249
|
end
|
data/lib/aws/dynamo_db/table.rb
CHANGED
@@ -154,15 +154,11 @@ module AWS
|
|
154
154
|
end
|
155
155
|
end
|
156
156
|
|
157
|
+
# Updates the provisioned throughput for this table.
|
157
158
|
# @param [Hash] options
|
158
|
-
#
|
159
|
-
# @option options [Integer] :
|
160
|
-
#
|
161
|
-
# @option options [Integer] :write_capacity_units
|
162
|
-
#
|
163
|
-
# @return [Hash] Returns a hash with the current throughput
|
164
|
-
# provisioning (`:read_capacity_units` and `:write_capacity_units`).
|
165
|
-
#
|
159
|
+
# @option options [Integer] :read_capacity_units The desired read capacity units.
|
160
|
+
# @option options [Integer] :write_capacity_units The desired write capacity units.
|
161
|
+
# @return [Hash] Returns the given `options` hash.
|
166
162
|
def provision_throughput options = {}
|
167
163
|
|
168
164
|
options[:read_capacity_units] ||= read_capacity_units
|
data/lib/aws/ec2.rb
CHANGED
@@ -123,7 +123,7 @@ module AWS
|
|
123
123
|
# In the following example we release all elastic IP addresses that are
|
124
124
|
# not currently associated with an instance:
|
125
125
|
#
|
126
|
-
# ec2.select{|ip| !ip.associated? }.each(&:release)
|
126
|
+
# ec2.elastic_ips.select{|ip| !ip.associated? }.each(&:release)
|
127
127
|
#
|
128
128
|
# ## Key Pairs
|
129
129
|
#
|
data/lib/aws/ec2/client.rb
CHANGED
@@ -17,7 +17,7 @@ module AWS
|
|
17
17
|
# Client class for Amazon Elastic Compute Cloud (EC2).
|
18
18
|
class Client < Core::QueryClient
|
19
19
|
|
20
|
-
API_VERSION = '
|
20
|
+
API_VERSION = '2014-05-01'
|
21
21
|
|
22
22
|
def sign_request request
|
23
23
|
version = @config.ec2_signature_version ?
|
@@ -31,6 +31,14 @@ module AWS
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
+
def retryable_error?(response)
|
35
|
+
if response.error.is_a?(Errors::InsufficientInstanceCapacity)
|
36
|
+
false
|
37
|
+
else
|
38
|
+
super
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
34
42
|
# @api private
|
35
43
|
CACHEABLE_REQUESTS = Set[
|
36
44
|
:describe_addresses,
|
@@ -97,5 +105,60 @@ module AWS
|
|
97
105
|
define_client_methods('2013-10-15')
|
98
106
|
end
|
99
107
|
|
108
|
+
class Client::V20140201 < Client
|
109
|
+
define_client_methods('2014-02-01')
|
110
|
+
end
|
111
|
+
|
112
|
+
class Client::V20140501 < Client
|
113
|
+
|
114
|
+
define_client_methods('2014-05-01')
|
115
|
+
|
116
|
+
alias basic_copy_snapshot copy_snapshot
|
117
|
+
|
118
|
+
def copy_snapshot(params = {})
|
119
|
+
# Adding logic to auto-compute the destination group and presigned
|
120
|
+
# url params for the copy snapshot operation. This is necessary
|
121
|
+
# when calling copy snapshot on snapshots for encrypted volumes.
|
122
|
+
# This addition should be transparent to the API user.
|
123
|
+
params = params.dup
|
124
|
+
params[:destination_region] = @region
|
125
|
+
params[:presigned_url] = presigned_copy_snapshot_url(params)
|
126
|
+
basic_copy_snapshot(params)
|
127
|
+
end
|
128
|
+
|
129
|
+
private
|
130
|
+
|
131
|
+
def presigned_copy_snapshot_url(params)
|
132
|
+
token = credential_provider.session_token
|
133
|
+
|
134
|
+
client = self.with_options(:ec2_region => params[:source_region])
|
135
|
+
|
136
|
+
req = client.build_request(:copy_snapshot, params)
|
137
|
+
|
138
|
+
now = req.remove_param("Timestamp").value
|
139
|
+
now = Time.parse(now).strftime("%Y%m%dT%H%M%SZ")
|
140
|
+
|
141
|
+
req.add_param("X-Amz-Algorithm", "AWS4-HMAC-SHA256")
|
142
|
+
req.add_param("X-Amz-Date", now)
|
143
|
+
req.add_param("X-Amz-SignedHeaders", 'host')
|
144
|
+
req.add_param("X-Amz-Expires", "3600")
|
145
|
+
req.add_param('X-Amz-Security-Token', token) if token
|
146
|
+
req.add_param("X-Amz-Credential", client.v4_signer.credential(now))
|
147
|
+
|
148
|
+
req.http_method = 'GET'
|
149
|
+
req.uri = '/?' + req.url_encoded_params
|
150
|
+
req.body = ''
|
151
|
+
req.headers.clear
|
152
|
+
req.headers['host'] = client.config.ec2_endpoint
|
153
|
+
|
154
|
+
key = client.v4_signer.derive_key(now)
|
155
|
+
sig = client.v4_signer.signature(req, key, now, client.v4_signer.class::EMPTY_DIGEST)
|
156
|
+
|
157
|
+
req.add_param('X-Amz-Signature', sig)
|
158
|
+
|
159
|
+
req.endpoint + '/?' + req.url_encoded_params
|
160
|
+
end
|
161
|
+
|
162
|
+
end
|
100
163
|
end
|
101
164
|
end
|
@@ -72,8 +72,7 @@ module AWS
|
|
72
72
|
|
73
73
|
# @yield [image] Each image in the collection.
|
74
74
|
# @return [nil]
|
75
|
-
def each &block
|
76
|
-
opts = {}
|
75
|
+
def each(opts = {}, &block)
|
77
76
|
opts[:owners] = @owners.map { |id| id.to_s } unless @owners.empty?
|
78
77
|
opts[:executable_users] = @executable_users.map { |id| id.to_s } unless
|
79
78
|
@executable_users.empty?
|
data/lib/aws/ec2/instance.rb
CHANGED
@@ -40,7 +40,7 @@ module AWS
|
|
40
40
|
# @attr [Boolean] ebs_optimized The instance must be in a stopped state to
|
41
41
|
# change the ebs_optimized state.
|
42
42
|
#
|
43
|
-
# @attr [Boolean] api_termination_disabled True if the instance
|
43
|
+
# @attr [Boolean] api_termination_disabled? True if the instance
|
44
44
|
# cannot be terminated using the {#terminate} method. This
|
45
45
|
# attribute can be changed at any time.
|
46
46
|
#
|
@@ -267,7 +267,7 @@ module AWS
|
|
267
267
|
|
268
268
|
describe_call_attribute :client_token
|
269
269
|
|
270
|
-
describe_call_attribute :image_id
|
270
|
+
describe_call_attribute :image_id, :static => true
|
271
271
|
|
272
272
|
describe_call_attribute :key_name, :static => true
|
273
273
|
|
@@ -304,7 +304,7 @@ module AWS
|
|
304
304
|
mutable_describe_call_attribute :ramdisk_id, :set_as => :ramdisk
|
305
305
|
|
306
306
|
mutable_describe_attribute :source_dest_check do
|
307
|
-
translates_output{|bool| bool == "true" }
|
307
|
+
translates_output{|bool| bool.to_s == "true" }
|
308
308
|
end
|
309
309
|
|
310
310
|
alias_method :source_dest_check?, :source_dest_check
|
@@ -12,7 +12,6 @@
|
|
12
12
|
# language governing permissions and limitations under the License.
|
13
13
|
|
14
14
|
require 'base64'
|
15
|
-
require 'uuidtools'
|
16
15
|
|
17
16
|
module AWS
|
18
17
|
class EC2
|
@@ -118,6 +117,9 @@ module AWS
|
|
118
117
|
# availability zone where the instance should run. Without
|
119
118
|
# this option, EC2 will choose an availability zone for you.
|
120
119
|
#
|
120
|
+
# @option options [String] :placement_group Specifies the
|
121
|
+
# cluster placement group where the instance should run.
|
122
|
+
#
|
121
123
|
# @option options [String] :image_id ID of the AMI you want to
|
122
124
|
# launch.
|
123
125
|
#
|
@@ -199,6 +201,8 @@ module AWS
|
|
199
201
|
# *NOTE:* EBS Optimized instances incur an additional service charge. This
|
200
202
|
# optional is only valid for certain instance types.
|
201
203
|
#
|
204
|
+
# @option options [Boolean] :associate_public_ip_address (false)
|
205
|
+
#
|
202
206
|
# @return [Instance or Array] If a single instance is being created,
|
203
207
|
# this returns an {EC2::Instance} to represent the newly
|
204
208
|
# created instance. Otherwise it returns an array of instance
|
@@ -255,6 +259,11 @@ module AWS
|
|
255
259
|
options.delete(:availability_zone)
|
256
260
|
end
|
257
261
|
|
262
|
+
if options[:placement_group]
|
263
|
+
placement[:group_name] = options[:placement_group].to_s
|
264
|
+
options.delete(:placement_group)
|
265
|
+
end
|
266
|
+
|
258
267
|
if options[:dedicated_tenancy]
|
259
268
|
placement[:tenancy] = 'dedicated'
|
260
269
|
options.delete(:dedicated_tenancy)
|
@@ -289,7 +298,7 @@ module AWS
|
|
289
298
|
|
290
299
|
security_group_opts(options)
|
291
300
|
|
292
|
-
options[:client_token] =
|
301
|
+
options[:client_token] = SecureRandom.uuid
|
293
302
|
|
294
303
|
resp = client.run_instances(options)
|
295
304
|
|
@@ -308,7 +317,9 @@ module AWS
|
|
308
317
|
response = filtered_request(:describe_instances)
|
309
318
|
response.reservation_set.each do |reservation|
|
310
319
|
reservation.instances_set.each do |i|
|
311
|
-
|
320
|
+
instance = Instance.new_from(:describe_instances, i,
|
321
|
+
i.instance_id, :config => config)
|
322
|
+
yield(instance)
|
312
323
|
end
|
313
324
|
end
|
314
325
|
end
|
@@ -29,7 +29,7 @@ module AWS
|
|
29
29
|
# snapshot.exists?
|
30
30
|
#
|
31
31
|
# @example Get a map of snapshot IDs to snapshot status
|
32
|
-
# ec2.snapshots.inject({}) { |m, s| m[
|
32
|
+
# ec2.snapshots.inject({}) { |m, s| m[s.id] = s.status; m }
|
33
33
|
# # => { "snap-12345678" => :pending, "snap-87654321" => :completed }
|
34
34
|
class SnapshotCollection < Collection
|
35
35
|
|
@@ -51,9 +51,13 @@ module AWS
|
|
51
51
|
include TaggedCollection
|
52
52
|
include Core::Collection::Simple
|
53
53
|
|
54
|
-
# Creates a Subnet. Subnets require a valid CIDR block and
|
55
|
-
#
|
56
|
-
#
|
54
|
+
# Creates a Subnet. Subnets require a valid CIDR block and are created
|
55
|
+
# inside an existing VPC. If you do not set an AvailabilityZone, then
|
56
|
+
# Amazon EC2 will select one for you (this is recommended).
|
57
|
+
#
|
58
|
+
# For complete information about creating subnets, see
|
59
|
+
# {http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-CreateSubnet.html
|
60
|
+
# CreateSubnet} in the Amazon EC2 API Reference.
|
57
61
|
#
|
58
62
|
# @param [String] cidr_block The CIDR block you want the subnet to
|
59
63
|
# cover (e.g., 10.0.0.0/24).
|
@@ -22,6 +22,20 @@ module AWS
|
|
22
22
|
#
|
23
23
|
module TaggedCollection
|
24
24
|
|
25
|
+
# Filters the collection by a paired tag key and value.
|
26
|
+
#
|
27
|
+
# ec2.instances.with_tag('role', 'web')
|
28
|
+
#
|
29
|
+
# You can filter a single tag key with multiple values:
|
30
|
+
#
|
31
|
+
# ec2.instances.with_tag('role', ['web', 'db'])
|
32
|
+
#
|
33
|
+
# @param [String] tag_key
|
34
|
+
# @param [String, Array<String>] tag_value
|
35
|
+
def with_tag(tag_key, *values)
|
36
|
+
filter("tag:#{tag_key}", *values)
|
37
|
+
end
|
38
|
+
|
25
39
|
# Filter the collection by one or more tag keys. If you pass multiple
|
26
40
|
# tag keys they will be be treated as OR conditions. If you want to
|
27
41
|
# AND them together call tagged multiple times (chained).
|