aws-sdk 1.3.9 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. data/lib/aws.rb +2 -0
  2. data/lib/aws/api_config/CloudFormation-2010-05-15.yml +204 -0
  3. data/lib/aws/api_config/EC2-2011-12-15.yml +0 -2
  4. data/lib/aws/auto_scaling.rb +1 -1
  5. data/lib/aws/auto_scaling/group.rb +1 -1
  6. data/lib/aws/auto_scaling/instance.rb +4 -4
  7. data/lib/aws/auto_scaling/notification_configuration_collection.rb +2 -2
  8. data/lib/aws/cloud_formation.rb +287 -0
  9. data/lib/aws/cloud_formation/client.rb +33 -0
  10. data/lib/aws/cloud_formation/client/xml.rb +32 -0
  11. data/lib/aws/cloud_formation/config.rb +18 -0
  12. data/lib/aws/cloud_formation/errors.rb +26 -0
  13. data/lib/aws/cloud_formation/request.rb +30 -0
  14. data/lib/aws/cloud_formation/stack.rb +255 -0
  15. data/lib/aws/cloud_formation/stack_collection.rb +206 -0
  16. data/lib/aws/cloud_formation/stack_event.rb +75 -0
  17. data/lib/aws/cloud_formation/stack_event_collection.rb +47 -0
  18. data/lib/aws/cloud_formation/stack_options.rb +72 -0
  19. data/lib/aws/cloud_formation/stack_output.rb +53 -0
  20. data/lib/aws/cloud_formation/stack_resource.rb +117 -0
  21. data/lib/aws/cloud_formation/stack_resource_collection.rb +84 -0
  22. data/lib/aws/cloud_formation/stack_resource_summary_collection.rb +72 -0
  23. data/lib/aws/cloud_formation/stack_summary.rb +71 -0
  24. data/lib/aws/cloud_formation/stack_summary_collection.rb +127 -0
  25. data/lib/aws/core.rb +5 -1
  26. data/lib/aws/core/configuration.rb +4 -1
  27. data/lib/aws/core/resource.rb +16 -0
  28. data/lib/aws/core/response.rb +7 -5
  29. data/lib/aws/ec2/elastic_ip.rb +53 -4
  30. data/lib/aws/ec2/elastic_ip_collection.rb +20 -7
  31. data/lib/aws/ec2/instance.rb +28 -7
  32. data/lib/aws/simple_email_service.rb +4 -6
  33. data/lib/aws/sts/request.rb +7 -1
  34. metadata +23 -5
@@ -15,9 +15,22 @@ module AWS
15
15
  class EC2
16
16
  class ElasticIpCollection < Collection
17
17
 
18
- def create
19
- response = client.allocate_address
18
+ # @param [Hash] options
19
+ #
20
+ # @option [Boolean] :vpc (false) When true, the elastic ip address
21
+ # will be allocated to your VPC.
22
+ #
23
+ # @return [ElasticIp]
24
+ #
25
+ def create options = {}
26
+
27
+ client_opts = {}
28
+ client_opts[:domain] = 'vpc' if options[:vpc]
29
+
30
+ response = client.allocate_address(client_opts)
31
+
20
32
  ElasticIp.new(response.public_ip, :config => config)
33
+
21
34
  end
22
35
 
23
36
  alias_method :allocate, :create
@@ -63,11 +76,11 @@ module AWS
63
76
  response = filtered_request(:describe_addresses)
64
77
  response.addresses_set.each do |address|
65
78
 
66
- options = {}
67
- options[:config] = config
68
- options[:instance_id] = address.instance_id
69
-
70
- elastic_ip = ElasticIp.new(address.public_ip, options)
79
+ elastic_ip = ElasticIp.new_from(
80
+ :describe_addresses,
81
+ address,
82
+ address.public_ip,
83
+ :config => config)
71
84
 
72
85
  yield(elastic_ip)
73
86
 
@@ -356,6 +356,11 @@ module AWS
356
356
  provider.provides :monitoring
357
357
  end
358
358
 
359
+ # @return [Boolean] Returns true if this is an EC2 VPC instance.
360
+ def vpc?
361
+ !!vpc_id
362
+ end
363
+
359
364
  # @return [VPC,nil] Returns the VPC this instance was launched in.
360
365
  # If this instance was not launched inside a VPC, nil is returned.
361
366
  def vpc
@@ -526,16 +531,32 @@ module AWS
526
531
 
527
532
  # Associates the elastic IP address with this instance.
528
533
  #
529
- # @param [ElasticIp,String] elastic_ip Either a public IP address
530
- # string or an {ElasticIp} object to associate to this
531
- # instance.
534
+ # @overload associate_elastic_ip(elastic_ip)
535
+ # @param [ElasticIp,String] elastic_ip An Elastic ip address
536
+ # (VPC or non-VPC) or a public ip address string (non-VPC only).
537
+ #
538
+ # @overload associate_elastic_ip(allocation_id)
539
+ # @param [String] allocation_id The allocation id of a
540
+ # VPC elastic ip address.
541
+ #
532
542
  # @return [nil]
543
+ #
533
544
  def associate_elastic_ip elastic_ip
534
- client.associate_address(
535
- :public_ip => elastic_ip.to_s,
536
- :instance_id => self.id
537
- )
545
+
546
+ client_opts = {}
547
+ client_opts[:instance_id] = self.id
548
+
549
+ if vpc?
550
+ client_opts[:allocation_id] = elastic_ip.is_a?(ElasticIp) ?
551
+ elastic_ip.allocation_id :
552
+ elastic_ip.to_s
553
+ else
554
+ client_opts[:public_ip] = elastic_ip.to_s
555
+ end
556
+
557
+ client.associate_address(client_opts)
538
558
  nil
559
+
539
560
  end
540
561
 
541
562
  alias_method :ip_address=, :associate_elastic_ip
@@ -290,14 +290,12 @@ module AWS
290
290
  send_opts = {}
291
291
  send_opts[:raw_message] = {}
292
292
  send_opts[:raw_message][:data] = raw_message.to_s
293
-
294
- if raw_message.class.name == 'Mail::Message'
295
- send_opts[:source] = raw_message.from.first
293
+ send_opts[:source] = options[:from] if options[:from]
294
+
295
+ if raw_message.respond_to?(:destinations)
296
296
  send_opts[:destinations] = raw_message.destinations
297
- else
298
- send_opts[:source] = options[:from] if options[:from]
299
- send_opts[:destinations] = [options[:to]].flatten if options[:to]
300
297
  end
298
+ send_opts[:destinations] = [options[:to]].flatten if options[:to]
301
299
 
302
300
  client.send_raw_email(send_opts)
303
301
  nil
@@ -16,7 +16,13 @@ module AWS
16
16
 
17
17
  # @private
18
18
  class Request < Core::Http::Request
19
- include Core::AuthorizeV2
19
+
20
+ include Core::AuthorizeV4
21
+
22
+ def service
23
+ 'sts'
24
+ end
25
+
20
26
  end
21
27
 
22
28
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 7
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
- - 3
9
- - 9
10
- version: 1.3.9
8
+ - 4
9
+ - 0
10
+ version: 1.4.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Amazon Web Services
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-03-30 00:00:00 Z
18
+ date: 2012-04-12 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  version_requirements: &id001 !ruby/object:Gem::Requirement
@@ -113,6 +113,23 @@ files:
113
113
  - lib/aws/auto_scaling/tag.rb
114
114
  - lib/aws/auto_scaling/tag_collection.rb
115
115
  - lib/aws/auto_scaling.rb
116
+ - lib/aws/cloud_formation/client/xml.rb
117
+ - lib/aws/cloud_formation/client.rb
118
+ - lib/aws/cloud_formation/config.rb
119
+ - lib/aws/cloud_formation/errors.rb
120
+ - lib/aws/cloud_formation/request.rb
121
+ - lib/aws/cloud_formation/stack.rb
122
+ - lib/aws/cloud_formation/stack_collection.rb
123
+ - lib/aws/cloud_formation/stack_event.rb
124
+ - lib/aws/cloud_formation/stack_event_collection.rb
125
+ - lib/aws/cloud_formation/stack_options.rb
126
+ - lib/aws/cloud_formation/stack_output.rb
127
+ - lib/aws/cloud_formation/stack_resource.rb
128
+ - lib/aws/cloud_formation/stack_resource_collection.rb
129
+ - lib/aws/cloud_formation/stack_resource_summary_collection.rb
130
+ - lib/aws/cloud_formation/stack_summary.rb
131
+ - lib/aws/cloud_formation/stack_summary_collection.rb
132
+ - lib/aws/cloud_formation.rb
116
133
  - lib/aws/core/api_config.rb
117
134
  - lib/aws/core/async_handle.rb
118
135
  - lib/aws/core/authorize_v2.rb
@@ -453,6 +470,7 @@ files:
453
470
  - lib/net/http/connection_pool/session.rb
454
471
  - lib/net/http/connection_pool.rb
455
472
  - lib/aws/api_config/AutoScaling-2011-01-01.yml
473
+ - lib/aws/api_config/CloudFormation-2010-05-15.yml
456
474
  - lib/aws/api_config/DynamoDB-2011-12-05.yml
457
475
  - lib/aws/api_config/EC2-2011-12-15.yml
458
476
  - lib/aws/api_config/ELB-2011-08-15.yml