sumomo 0.5.1 → 0.5.2

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: 4c0aec7dfbd51571b44f70f0532b877bb093ef36
4
- data.tar.gz: a51f3fd48b09469778fae17717b4ceeac25554ed
3
+ metadata.gz: 110f516e89512e4936f04d82b33c4796c2e4cec6
4
+ data.tar.gz: 969ce92b2f2915977fdc83fa5895737faa9df58f
5
5
  SHA512:
6
- metadata.gz: 1a328e7cdec011af8547674d49cd8988eb6414c0d5022a63933132b291d3e5494af8e5812e2a234812476d7d3b57105b3d4a85b5a7db016416faafa5e64a2b0e
7
- data.tar.gz: f25124e67227df90462a40857219922bee0717a31cde75f2d1206662ed0b8da0d4ec05c792a522a728bdc48424b361b12ce07881d7dd2278a261c8d3258c5037
6
+ metadata.gz: 5c5218b0256df836d1d9ba809a536a0fc5e22830a0cbfdca1c6c1bdacd4ef6f8e34b4abfc2e02f5d8a6434291f96bcb8c5939c0ffcb5cc10b4c73e21aabf5324
7
+ data.tar.gz: 999e3bfcd1bbd7c53a62723b77990b5c1aa1ba87d113008b1165791f8baf6519ccd3c52029041af9509a65df3757470696462244b8a13745afb21da0e707be57
@@ -0,0 +1,101 @@
1
+ var apigateway = new aws.APIGateway({region: request.ResourceProperties.Region});
2
+
3
+ var params = {
4
+ domainName: request.ResourceProperties.DomainName
5
+ }
6
+
7
+ if (request.ResourceProperties.CertificateArn)
8
+ {
9
+ params.certificateArn = request.ResourceProperties.CertificateArn;
10
+ }
11
+
12
+ function createName(onSuccess, onFail)
13
+ {
14
+ apigateway.createDomainName(params, function(err, data)
15
+ {
16
+ if (err)
17
+ {
18
+ console.log(err, err.stack);
19
+ onFail(err);
20
+ }
21
+ else
22
+ {
23
+ store.put("domainName", request.ResourceProperties.DomainName, function()
24
+ {
25
+ onSuccess(data);
26
+ },
27
+ function(err)
28
+ {
29
+ onFail(err);
30
+ });
31
+ }
32
+ });
33
+ }
34
+
35
+ function deleteName(onSuccess, onFail)
36
+ {
37
+ store.get("domainName", function(name)
38
+ {
39
+ apigateway.deleteDomainName({
40
+ domainName: name
41
+
42
+ }, function(err, data)
43
+ {
44
+ if (err)
45
+ {
46
+ onFail(err);
47
+ }
48
+ else
49
+ {
50
+ onSuccess(name);
51
+ }
52
+ });
53
+ },
54
+ function(err)
55
+ {
56
+ onFail(err);
57
+ });
58
+ }
59
+
60
+ if (request.RequestType == "Create")
61
+ {
62
+ createName(function(data)
63
+ {
64
+ Cloudformation.send(request, context, Cloudformation.SUCCESS, {}, "Success", data.domainName);
65
+ },
66
+ function(err)
67
+ {
68
+ Cloudformation.send(request, context, Cloudformation.FAILED, {}, "Error: " + err);
69
+ });
70
+ }
71
+
72
+ if (request.RequestType == "Update")
73
+ {
74
+ deleteName(function(name)
75
+ {
76
+ createName(function(data)
77
+ {
78
+ Cloudformation.send(request, context, Cloudformation.SUCCESS, {}, "Success", data.domainName);
79
+ },
80
+ function(err)
81
+ {
82
+ Cloudformation.send(request, context, Cloudformation.FAILED, {}, "Error: " + err);
83
+ });
84
+ },
85
+ function(err)
86
+ {
87
+ Cloudformation.send(request, context, Cloudformation.FAILED, {}, "Error: " + err);
88
+ });
89
+ }
90
+
91
+ if (request.RequestType == "Delete")
92
+ {
93
+ deleteName(function(name)
94
+ {
95
+ Cloudformation.send(request, context, Cloudformation.SUCCESS, {}, "Success", "");
96
+ },
97
+ function(err)
98
+ {
99
+ Cloudformation.send(request, context, Cloudformation.FAILED, {}, "Error: " + err);
100
+ });
101
+ }
@@ -145,6 +145,11 @@ module Sumomo
145
145
  "Effect" => "Allow",
146
146
  "Action" => ["cloudfront:CreateCloudFrontOriginAccessIdentity", "cloudfront:DeleteCloudFrontOriginAccessIdentity"],
147
147
  "Resource" => "*"
148
+ },
149
+ {
150
+ "Effect" => "Allow",
151
+ "Action" => ["apigateway:*", "cloudfront:UpdateDistribution"],
152
+ "Resource" => "*"
148
153
  }]
149
154
  }
150
155
  }
@@ -1,3 +1,3 @@
1
1
  module Sumomo
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sumomo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Siaw
@@ -168,6 +168,7 @@ files:
168
168
  - bin/setup
169
169
  - data/sumomo/custom_resource_utils.js
170
170
  - data/sumomo/custom_resources/AMILookup.js
171
+ - data/sumomo/custom_resources/APIDomainName.js
171
172
  - data/sumomo/custom_resources/AvailabilityZones.js
172
173
  - data/sumomo/custom_resources/CloudflareCNAME.js
173
174
  - data/sumomo/custom_resources/DeployTime.js