fog-aws 1.0.0 → 1.1.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: b81ad3bfcfe0482650342c825be51289c0530ab5
4
- data.tar.gz: 72f9f0dfc281ec1454f318a43d148bd049b68b21
3
+ metadata.gz: f7ed98704279ce0f10689cfe548af6163b1ab02f
4
+ data.tar.gz: 2e2b92d7a351e877f6cfc012626e1b8dbdbbc73d
5
5
  SHA512:
6
- metadata.gz: 9a06e4f197b2cdc74e01d4e3b975fcfc696b44c09fd82e2ffef77e35b84697a6b9afcdfb271f68ecb7d7a3b0326d7f0898742a2ca0d58d6f120e371e5cc12266
7
- data.tar.gz: eb2936873d29e923a8a9e9b66d0fa3aba653c185332c0ee733ccecf44d29db09911b22c7be59d4a8b9aa7dfa208bad09ea3d3418a5ef2103fa8c79dad0a5b1eb
6
+ metadata.gz: 1e59ea6e563f7bf85eabe38ac7d3507f5b7c4b6a0c9d205ff10d187052894a3bdb53c9299c97d929255ccdaf1142c71d0e03f0a7688a46d5bae71d4070c77018
7
+ data.tar.gz: e32073dbc8772718f1cd830226b6543023f5f543bb80b5a5f9a40c26c9fcf0b5ec024dae8e52258afdc8f6f367538fc4ec3b56a3c718b55125865b00c9dbb55d
@@ -2,7 +2,21 @@
2
2
 
3
3
  ## [Unreleased](https://github.com/fog/fog-aws/tree/HEAD)
4
4
 
5
- [Full Changelog](https://github.com/fog/fog-aws/compare/v0.13.0...HEAD)
5
+ [Full Changelog](https://github.com/fog/fog-aws/compare/v1.0.0...HEAD)
6
+
7
+ **Closed issues:**
8
+
9
+ - Support new Ohio region \(us-east-2\) [\#313](https://github.com/fog/fog-aws/issues/313)
10
+
11
+ **Merged pull requests:**
12
+
13
+ - Canada and London regions [\#333](https://github.com/fog/fog-aws/pull/333) ([mattheworiordan](https://github.com/mattheworiordan))
14
+ - Updated ELB Dual Stack hosted zone DNS records [\#332](https://github.com/fog/fog-aws/pull/332) ([mattheworiordan](https://github.com/mattheworiordan))
15
+ - Added support for attaching auto scaling groups to target groups [\#330](https://github.com/fog/fog-aws/pull/330) ([maf23](https://github.com/maf23))
16
+ - credential\_fetcher: Mark AWS metadata calls as idempotent [\#329](https://github.com/fog/fog-aws/pull/329) ([mtekel](https://github.com/mtekel))
17
+
18
+ ## [v1.0.0](https://github.com/fog/fog-aws/tree/v1.0.0) (2016-12-12)
19
+ [Full Changelog](https://github.com/fog/fog-aws/compare/v0.13.0...v1.0.0)
6
20
 
7
21
  **Merged pull requests:**
8
22
 
@@ -228,7 +228,7 @@ module Fog
228
228
  end
229
229
 
230
230
  def self.regions
231
- @regions ||= ['ap-northeast-1', 'ap-northeast-2', 'ap-southeast-1', 'ap-southeast-2', 'eu-central-1', 'eu-west-1', 'us-east-1', 'us-east-2', 'us-west-1', 'us-west-2', 'sa-east-1', 'cn-north-1', 'us-gov-west-1', 'ap-south-1']
231
+ @regions ||= ['ap-northeast-1', 'ap-northeast-2', 'ap-southeast-1', 'ap-southeast-2', 'eu-central-1', 'ca-central-1', 'eu-west-1', 'eu-west-2', 'us-east-1', 'us-east-2', 'us-west-1', 'us-west-2', 'sa-east-1', 'cn-north-1', 'us-gov-west-1', 'ap-south-1']
232
232
  end
233
233
 
234
234
  def self.validate_region!(region, host=nil)
@@ -12,6 +12,7 @@ module Fog
12
12
 
13
13
  request_path 'fog/aws/requests/auto_scaling'
14
14
  request :attach_load_balancers
15
+ request :attach_load_balancer_target_groups
15
16
  request :create_auto_scaling_group
16
17
  request :create_launch_configuration
17
18
  request :create_or_update_tags
@@ -35,6 +36,7 @@ module Fog
35
36
  request :describe_tags
36
37
  request :describe_termination_policy_types
37
38
  request :detach_load_balancers
39
+ request :detach_load_balancer_target_groups
38
40
  request :detach_instances
39
41
  request :attach_instances
40
42
  request :disable_metrics_collection
@@ -21,15 +21,15 @@ module Fog
21
21
  if ENV["AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"]
22
22
  connection = options[:connection] || Excon.new(CONTAINER_CREDENTIALS_HOST)
23
23
  credential_path = options[:credential_path] || ENV["AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"]
24
- role_data = connection.get(:path => credential_path, :expects => 200).body
24
+ role_data = connection.get(:path => credential_path, :idempotent => true, :expects => 200).body
25
25
 
26
26
  connection = options[:metadata_connection] || Excon.new(INSTANCE_METADATA_HOST)
27
- az_data = connection.get(:path => INSTANCE_METADATA_AZ, :expects => 200).body
27
+ az_data = connection.get(:path => INSTANCE_METADATA_AZ, :idempotent => true, :expects => 200).body
28
28
  else
29
29
  connection = options[:connection] || Excon.new(INSTANCE_METADATA_HOST)
30
- role_name = connection.get(:path => INSTANCE_METADATA_PATH, :expects => 200).body
31
- role_data = connection.get(:path => INSTANCE_METADATA_PATH+role_name, :expects => 200).body
32
- az_data = connection.get(:path => INSTANCE_METADATA_AZ, :expects => 200).body
30
+ role_name = connection.get(:path => INSTANCE_METADATA_PATH, :idempotent => true, :expects => 200).body
31
+ role_data = connection.get(:path => INSTANCE_METADATA_PATH+role_name, :idempotent => true, :expects => 200).body
32
+ az_data = connection.get(:path => INSTANCE_METADATA_AZ, :idempotent => true, :expects => 200).body
33
33
  end
34
34
 
35
35
  region = az_data[0..-2] # get region from az
@@ -75,6 +75,18 @@ module Fog
75
75
  reload
76
76
  end
77
77
 
78
+ def attach_load_balancer_target_groups(*target_group_arns)
79
+ requires :id
80
+ service.attach_load_balancer_target_groups(id, 'TargetGroupARNs' => target_group_arns)
81
+ reload
82
+ end
83
+
84
+ def detach_load_balancer_target_groups(*target_group_arns)
85
+ requires :id
86
+ service.detach_load_balancer_target_groups(id, 'TargetGroupARNs' => target_group_arns)
87
+ reload
88
+ end
89
+
78
90
  def disable_metrics_collection(metrics = {})
79
91
  requires :id
80
92
  service.disable_metrics_collection(id, 'Metrics' => metrics)
@@ -0,0 +1,58 @@
1
+ module Fog
2
+ module AWS
3
+ class AutoScaling
4
+ class Real
5
+ require 'fog/aws/parsers/auto_scaling/basic'
6
+
7
+ # Attaches one or more load balancer target groups to the specified Auto Scaling
8
+ # group.
9
+ #
10
+ # ==== Parameters
11
+ # * auto_scaling_group_name<~String> - The name of the Auto Scaling
12
+ # group.
13
+ # * options<~Hash>:
14
+ # 'TagetGroupARNs'<~Array> - A list of target group arns to use.
15
+ #
16
+ # ==== See Also
17
+ # http://docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_AttachLoadBalancerTargetGroups.html
18
+ #
19
+
20
+ ExpectedOptions[:attach_load_balancer_target_groups] = %w[TargetGroupARNs]
21
+
22
+ def attach_load_balancer_target_groups(auto_scaling_group_name, options = {})
23
+ if target_group_arns = options.delete('TargetGroupARNs')
24
+ options.merge!(AWS.indexed_param('TargetGroupARNs.member.%d', *target_group_arns))
25
+ end
26
+
27
+ request({
28
+ 'Action' => 'AttachLoadBalancerTargetGroups',
29
+ 'AutoScalingGroupName' => auto_scaling_group_name,
30
+ :parser => Fog::Parsers::AWS::AutoScaling::Basic.new
31
+ }.merge!(options))
32
+ end
33
+
34
+ end
35
+
36
+ class Mock
37
+ def attach_load_balancer_target_groups(auto_scaling_group_name, options = {})
38
+ unexpected_options = options.keys - ExpectedOptions[:attach_load_balancer_target_groups]
39
+
40
+ unless unexpected_options.empty?
41
+ raise Fog::AWS::AutoScaling::ValidationError.new("Options #{unexpected_options.join(',')} should not be included in request")
42
+ end
43
+
44
+ unless self.data[:auto_scaling_groups].key?(auto_scaling_group_name)
45
+ raise Fog::AWS::AutoScaling::ValidationError.new('AutoScalingGroup name not found - null')
46
+ end
47
+
48
+ response = Excon::Response.new
49
+ response.status = 200
50
+ response.body = {
51
+ 'ResponseMetadata' => { 'RequestId' => Fog::AWS::Mock.request_id }
52
+ }
53
+ response
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,57 @@
1
+ module Fog
2
+ module AWS
3
+ class AutoScaling
4
+ class Real
5
+ require 'fog/aws/parsers/auto_scaling/basic'
6
+
7
+ # Removes one or more load balancer target groups from the specified
8
+ # Auto Scaling group.
9
+ #
10
+ # ==== Parameters
11
+ # * auto_scaling_group_name<~String> - The name of the Auto Scaling
12
+ # group.
13
+ # * options<~Hash>:
14
+ # 'TargetGroupARNs'<~Array> - A list of target groups to detach.
15
+ #
16
+ # ==== See Also
17
+ # http://docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_DetachLoadBalancerTargetGroups.html
18
+ #
19
+
20
+ ExpectedOptions[:detach_load_balancer_target_groups] = %w[TargetGroupARNs]
21
+
22
+ def detach_load_balancer_target_groups(auto_scaling_group_name, options = {})
23
+ if target_group_arns = options.delete('TargetGroupARNs')
24
+ options.merge!(AWS.indexed_param('TargetGroupARNs.member.%d', *target_group_arns))
25
+ end
26
+
27
+ request({
28
+ 'Action' => 'DetachLoadBalancerTargetGroups',
29
+ 'AutoScalingGroupName' => auto_scaling_group_name,
30
+ :parser => Fog::Parsers::AWS::AutoScaling::Basic.new
31
+ }.merge!(options))
32
+ end
33
+ end
34
+
35
+ class Mock
36
+ def detach_load_balancer_target_groups(auto_scaling_group_name, options = {})
37
+ unexpected_options = options.keys - ExpectedOptions[:detach_load_balancer_target_groups]
38
+
39
+ unless unexpected_options.empty?
40
+ raise Fog::AWS::AutoScaling::ValidationError.new("Options #{unexpected_options.join(',')} should not be included in request")
41
+ end
42
+
43
+ unless self.data[:auto_scaling_groups].key?(auto_scaling_group_name)
44
+ raise Fog::AWS::AutoScaling::ValidationError.new('AutoScalingGroup name not found - null')
45
+ end
46
+
47
+ response = Excon::Response.new
48
+ response.status = 200
49
+ response.body = {
50
+ 'ResponseMetadata' => { 'RequestId' => Fog::AWS::Mock.request_id }
51
+ }
52
+ response
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
@@ -67,9 +67,15 @@ module Fog
67
67
  {"messageSet" => [], "regionName" => "eu-west-1", "zoneName" => "eu-west-1b", "zoneState" => "available"},
68
68
  {"messageSet" => [], "regionName" => "eu-west-1", "zoneName" => "eu-west-1c", "zoneState" => "available"},
69
69
 
70
+ {"messageSet" => [], "regionName" => "eu-west-2", "zoneName" => "eu-west-2a", "zoneState" => "available"},
71
+ {"messageSet" => [], "regionName" => "eu-west-2", "zoneName" => "eu-west-2b", "zoneState" => "available"},
72
+
70
73
  {"messageSet" => [], "regionName" => "eu-central-1", "zoneName" => "eu-central-1a", "zoneState" => "available"},
71
74
  {"messageSet" => [], "regionName" => "eu-central-1", "zoneName" => "eu-central-1b", "zoneState" => "available"},
72
75
 
76
+ {"messageSet" => [], "regionName" => "ca-central-1", "zoneName" => "ca-central-1a", "zoneState" => "available"},
77
+ {"messageSet" => [], "regionName" => "ca-central-1", "zoneName" => "ca-central-1b", "zoneState" => "available"},
78
+
73
79
  {"messageSet" => [], "regionName" => "ap-northeast-1", "zoneName" => "ap-northeast-1a", "zoneState" => "available"},
74
80
  {"messageSet" => [], "regionName" => "ap-northeast-1", "zoneName" => "ap-northeast-1b", "zoneState" => "available"},
75
81
 
@@ -29,17 +29,25 @@ module Fog
29
29
  end
30
30
 
31
31
  # See https://forums.aws.amazon.com/message.jspa?messageID=612414
32
+ # Note: Oddly, to update this list, I have had to revert to going to
33
+ # dev console at https://console.aws.amazon.com/route53/home, then using
34
+ # search all sources for Z14GRHDCWA56QT to find this in a HashMap
32
35
  def self.elb_dualstack_hosted_zone_mapping
33
36
  @elb_dualstack_hosted_zone_mapping ||= {
34
37
  "ap-northeast-1" => "Z14GRHDCWA56QT",
38
+ "ap-northeast-2" => "ZWKZPGTI48KDX",
39
+ "ap-south-1" => "ZP97RAFLXTNZK",
35
40
  "ap-southeast-1" => "Z1LMS91P8CMLE5",
36
41
  "ap-southeast-2" => "Z1GM3OXH4ZPM65",
37
- "eu-central-1" => "Z215JYRZR1TBD5",
38
- "eu-west-1" => "Z32O12XQLNTSW2",
39
- "sa-east-1" => "Z2P70J7HTTTPLU",
40
- "us-east-1" => "Z35SXDOTRQ7X7K",
41
- "us-west-1" => "Z368ELLRRE2KJ0",
42
- "us-west-2" => "Z1H1FL5HABSF5",
42
+ "ca-central-1" => "ZQSVJUPU6J1EY",
43
+ "eu-central-1" => "Z215JYRZR1TBD5",
44
+ "eu-west-1" => "Z32O12XQLNTSW2",
45
+ "eu-west-2" => "ZHURV8PSTC4K8",
46
+ "us-east-1" => "Z35SXDOTRQ7X7K",
47
+ "us-east-2" => "Z3AADJGX6KTTL2",
48
+ "us-west-1" => "Z368ELLRRE2KJ0",
49
+ "us-west-2" => "Z1H1FL5HABSF5",
50
+ "sa-east-1" => "Z2P70J7HTTTPLU",
43
51
  }
44
52
  end
45
53
 
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module AWS
3
- VERSION = "1.0.0"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
@@ -35,6 +35,14 @@ Shindo.tests('AWS::AutoScaling | auto_scaling_tests', ['aws', 'auto_scaling']) d
35
35
  Fog::AWS[:auto_scaling].detach_load_balancers(@asg_name, 'LoadBalancerNames' => 'elb-test-fog').body
36
36
  end
37
37
 
38
+ tests("#attach_load_balancer_target_groups").formats(AWS::AutoScaling::Formats::BASIC) do
39
+ Fog::AWS[:auto_scaling].attach_load_balancer_target_groups(@asg_name, 'TargetGroupARNs' => 'elb-test-fog').body
40
+ end
41
+
42
+ tests("#detach_load_balancer_target_groups").formats(AWS::AutoScaling::Formats::BASIC) do
43
+ Fog::AWS[:auto_scaling].detach_load_balancer_target_groups(@asg_name, 'TargetGroupARNs' => 'elb-test-fog').body
44
+ end
45
+
38
46
  tests("#detach_instances").formats(AWS::AutoScaling::Formats::BASIC) do
39
47
  Fog::AWS[:auto_scaling].detach_instances(@asg_name, 'InstanceIds' => 'i-deadbeef').body
40
48
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Lane
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-12-12 00:00:00.000000000 Z
12
+ date: 2016-12-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -730,6 +730,7 @@ files:
730
730
  - lib/fog/aws/rds.rb
731
731
  - lib/fog/aws/redshift.rb
732
732
  - lib/fog/aws/requests/auto_scaling/attach_instances.rb
733
+ - lib/fog/aws/requests/auto_scaling/attach_load_balancer_target_groups.rb
733
734
  - lib/fog/aws/requests/auto_scaling/attach_load_balancers.rb
734
735
  - lib/fog/aws/requests/auto_scaling/create_auto_scaling_group.rb
735
736
  - lib/fog/aws/requests/auto_scaling/create_launch_configuration.rb
@@ -754,6 +755,7 @@ files:
754
755
  - lib/fog/aws/requests/auto_scaling/describe_tags.rb
755
756
  - lib/fog/aws/requests/auto_scaling/describe_termination_policy_types.rb
756
757
  - lib/fog/aws/requests/auto_scaling/detach_instances.rb
758
+ - lib/fog/aws/requests/auto_scaling/detach_load_balancer_target_groups.rb
757
759
  - lib/fog/aws/requests/auto_scaling/detach_load_balancers.rb
758
760
  - lib/fog/aws/requests/auto_scaling/disable_metrics_collection.rb
759
761
  - lib/fog/aws/requests/auto_scaling/enable_metrics_collection.rb