sumomo 0.8.12 → 0.8.15
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.
- checksums.yaml +4 -4
- data/README.md +12 -11
- data/data/sumomo/custom_resources/ACMCertificate.js +32 -1
- data/data/sumomo/custom_resources/ACMCertificateWaiter.js +4 -0
- data/data/sumomo/custom_resources/AMILookup.js +378 -150
- data/data/sumomo/custom_resources/SelectSpot.js +376 -142
- data/exe/sumomo +4 -1
- data/lib/sumomo/ec2.rb +5 -1
- data/lib/sumomo/stack.rb +7 -4
- data/lib/sumomo/version.rb +1 -1
- data/lib/sumomo.rb +2 -1
- data/sumomo.gemspec +6 -4
- data/update-spec.rb +381 -0
- metadata +45 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d31828749cf57f094afad4100d0a2c41e1e23db623f4d83c7af92ea09973a2b
|
4
|
+
data.tar.gz: 2651d1c3f796f9153199aee4077f7f5ee3aa2c65d35fa764d01309fc90e7b117
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea85e42594b8bd2c22396d9904277b97307256335f1a2a95c397ecd5cde7b90a2fdbd4a909576080d5e371c2d7130c7c5f3043d6e0086d7a8fbd965b6e7ad700
|
7
|
+
data.tar.gz: f963dd40b6a1ba5a4de069310d6c44e1d55254008093bbc7933ad37096e797b8a10faabc0936b6c591f6bea85a9ac80bb9f3862b33315b8bc7825c5921dd64ac
|
data/README.md
CHANGED
@@ -75,22 +75,23 @@ Sumomo::wait_for_stack(name: "mystack", region: "ap-northeast-1")
|
|
75
75
|
You can make a server
|
76
76
|
|
77
77
|
```ruby
|
78
|
-
network = make_network(layers: [
|
79
|
-
|
78
|
+
network = make_network(layers: %w[web])
|
80
79
|
eip = make "AWS::EC2::EIP"
|
81
80
|
|
82
81
|
make_autoscaling_group(
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
82
|
+
network: network,
|
83
|
+
layer: 'web',
|
84
|
+
eip: eip,
|
85
|
+
type: "a1.medium",
|
86
|
+
vol_size: 15, # GB,
|
87
|
+
script: <<-SCRIPT
|
88
|
+
yum install git gcc g++
|
89
|
+
echo "hello world" >> ~/hello
|
90
|
+
SCRIPT
|
92
91
|
)
|
93
92
|
|
93
|
+
output 'IP', eip
|
94
|
+
|
94
95
|
```
|
95
96
|
|
96
97
|
You can make apis with this now
|
@@ -4,6 +4,8 @@ var acm = new aws.ACM({region: cert_region});
|
|
4
4
|
|
5
5
|
var return_properties = {};
|
6
6
|
|
7
|
+
var retries = 0;
|
8
|
+
|
7
9
|
function extractRootDomain(domain)
|
8
10
|
{
|
9
11
|
var splitArr = domain.split('.');
|
@@ -12,26 +14,55 @@ function extractRootDomain(domain)
|
|
12
14
|
//extracting the root domain here
|
13
15
|
if (arrLen > 2)
|
14
16
|
{
|
15
|
-
domain = splitArr
|
17
|
+
domain = splitArr.slice(1).join(".");
|
16
18
|
}
|
17
19
|
return domain;
|
18
20
|
}
|
19
21
|
|
20
22
|
function wait_for_approval(domain_name, on_success, on_fail)
|
21
23
|
{
|
24
|
+
console.log('read domain: ', domain_name);
|
22
25
|
get_domain(domain_name, function(data)
|
23
26
|
{
|
27
|
+
console.log('loaded domain data: ');
|
28
|
+
console.log(data);
|
29
|
+
|
24
30
|
var params = {
|
25
31
|
CertificateArn: data.arn
|
26
32
|
};
|
27
33
|
|
28
34
|
acm.describeCertificate(params, function(err, cert_data) {
|
35
|
+
console.log('received certificate data');
|
36
|
+
console.log(cert_data);
|
37
|
+
console.log(cert_data.Certificate.DomainValidationOptions);
|
38
|
+
console.log(cert_data.Certificate.DomainValidationOptions[0]);
|
39
|
+
|
40
|
+
|
29
41
|
if (err)
|
30
42
|
{
|
31
43
|
on_fail(err);
|
32
44
|
}
|
33
45
|
else
|
34
46
|
{
|
47
|
+
if (!cert_data.Certificate.DomainValidationOptions[0].ResourceRecord)
|
48
|
+
{
|
49
|
+
// damn AWS now does not return this information immediately
|
50
|
+
// and we have to wait for it.
|
51
|
+
return setTimeout(function()
|
52
|
+
{
|
53
|
+
console.log('no ResourceRecord found, retrying...', "attempts:", retries);
|
54
|
+
if (retries < 60)
|
55
|
+
{
|
56
|
+
wait_for_approval(domain_name, on_success, on_fail);
|
57
|
+
retries += 1;
|
58
|
+
}
|
59
|
+
else
|
60
|
+
{
|
61
|
+
on_fail('AWS did not return ResourceRecord. (AWS issue)');
|
62
|
+
}
|
63
|
+
|
64
|
+
}, 1000);
|
65
|
+
}
|
35
66
|
// Do not wait if we requested DNS validation
|
36
67
|
if (request.ResourceProperties.ValidationMethod === "DNS")
|
37
68
|
{
|
@@ -11,6 +11,8 @@ function wait_for_approval(on_success, on_fail)
|
|
11
11
|
};
|
12
12
|
|
13
13
|
acm.describeCertificate(params, function(err, cert_data) {
|
14
|
+
console.log('describe certificate data');
|
15
|
+
console.log(cert_data);;
|
14
16
|
if (err)
|
15
17
|
{
|
16
18
|
on_fail(err);
|
@@ -38,6 +40,8 @@ function wait_for_approval(on_success, on_fail)
|
|
38
40
|
|
39
41
|
function fail(err)
|
40
42
|
{
|
43
|
+
console.log('Errored.');
|
44
|
+
console.log(err);
|
41
45
|
Cloudformation.send(request, context, Cloudformation.FAILED, {}, "Error: " + err);
|
42
46
|
}
|
43
47
|
|