cloudstrap 0.31.1.pre → 0.32.5.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cloudstrap/amazon/ec2.rb +5 -0
- data/lib/cloudstrap/amazon/elb.rb +27 -2
- data/lib/cloudstrap/amazon/route53.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1bea105bb2688899a8f16b53bf5e1dcceb9466f
|
4
|
+
data.tar.gz: bb2c9cc629e47e893a2e34757d980eeb1a9941b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f38f340ad7c12306653b4552e5bf8bd75218b6e3f5fb7e90a0af1b4446b05ffaa6866beeba212d5629a321f04c1079f5a6eeba11486f009811ddef2416ac4a7
|
7
|
+
data.tar.gz: f3474f5b31087fe2a2b39e037163f6255c86180e3e3588316d56845df0c0e9092c9955adfff88e9a6dc09752045decf05625a6bde178384af9eff2a58d240598
|
@@ -15,6 +15,11 @@ module Cloudstrap
|
|
15
15
|
@vpcs = call_api(:describe_vpcs).vpcs
|
16
16
|
end
|
17
17
|
|
18
|
+
Contract None => Bool
|
19
|
+
def vpc_exists?(vpc_id)
|
20
|
+
vpcs.any? { |vpc| vpc.vpc_id == vpc_id }
|
21
|
+
end
|
22
|
+
|
18
23
|
Contract String => Bool
|
19
24
|
def vpc_supports_dns?(vpc_id)
|
20
25
|
call_api(:describe_vpc_attribute, vpc_id: vpc_id, attribute: "enableDnsSupport").enable_dns_support.value
|
@@ -18,10 +18,27 @@ module Cloudstrap
|
|
18
18
|
@list = call_api(:describe_load_balancers).load_balancer_descriptions
|
19
19
|
end
|
20
20
|
|
21
|
+
Contract None => ArrayOf[String]
|
22
|
+
def names
|
23
|
+
list.map(&:load_balancer_name)
|
24
|
+
end
|
25
|
+
|
21
26
|
Tags = HashOf[String, String]
|
22
27
|
|
23
|
-
Contract
|
24
|
-
def tags
|
28
|
+
Contract None => HashOf[String, Tags]
|
29
|
+
def tags
|
30
|
+
@tags ||= tags!
|
31
|
+
end
|
32
|
+
|
33
|
+
Contract None => HashOf[String, Tags]
|
34
|
+
def tags!
|
35
|
+
@tags = names.each_slice(20).flat_map do |slice|
|
36
|
+
tags(slice)
|
37
|
+
end.reduce(&:merge)
|
38
|
+
end
|
39
|
+
|
40
|
+
Contract ArrayOf[String] => HashOf[String, Tags]
|
41
|
+
def tags(elb_names)
|
25
42
|
describe_tags(*elb_names).each_with_object({}) do |description, hash|
|
26
43
|
hash[description.load_balancer_name] = description
|
27
44
|
.tags
|
@@ -30,6 +47,14 @@ module Cloudstrap
|
|
30
47
|
end
|
31
48
|
end
|
32
49
|
|
50
|
+
Contract String => HashOf[String, ::Aws::ElasticLoadBalancing::Types::LoadBalancerDescription]
|
51
|
+
def tagged(key)
|
52
|
+
tags.map do |name, tags|
|
53
|
+
next unless tags[key]
|
54
|
+
{ tags[key] => list.find { |elb| elb.load_balancer_name == name } }
|
55
|
+
end.compact.reduce(&:merge)
|
56
|
+
end
|
57
|
+
|
33
58
|
private
|
34
59
|
|
35
60
|
Contract Args[String] => ArrayOf[::Aws::ElasticLoadBalancing::Types::TagDescription]
|
@@ -20,7 +20,7 @@ module Cloudstrap
|
|
20
20
|
|
21
21
|
Contract String => Maybe[::Aws::Route53::Types::HostedZone]
|
22
22
|
def zone(name)
|
23
|
-
name
|
23
|
+
name = name.end_with?('.') ? name : name.dup.concat('.')
|
24
24
|
|
25
25
|
zones.find { |zone| zone.name == name }
|
26
26
|
end
|