sumomo 0.8.15 → 0.8.17

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d31828749cf57f094afad4100d0a2c41e1e23db623f4d83c7af92ea09973a2b
4
- data.tar.gz: 2651d1c3f796f9153199aee4077f7f5ee3aa2c65d35fa764d01309fc90e7b117
3
+ metadata.gz: 861b39ec9371ce0ecf43abc366deedd675c34e38e3489712797acb7231361c54
4
+ data.tar.gz: a5411af6f6cb532a72c80ca5cf575e0ba5a2f1cce9ef7742e4a9d50ebfb704c6
5
5
  SHA512:
6
- metadata.gz: ea85e42594b8bd2c22396d9904277b97307256335f1a2a95c397ecd5cde7b90a2fdbd4a909576080d5e371c2d7130c7c5f3043d6e0086d7a8fbd965b6e7ad700
7
- data.tar.gz: f963dd40b6a1ba5a4de069310d6c44e1d55254008093bbc7933ad37096e797b8a10faabc0936b6c591f6bea85a9ac80bb9f3862b33315b8bc7825c5921dd64ac
6
+ metadata.gz: 948c3afa11295e67d58e4c487be8fd296026ff392f5da3c50d9c718875524c47dfeb76cea0ec00a6fc436844800aeea6a59d5d559193bc3016428e285d14d659
7
+ data.tar.gz: 07f8164e9b86b8dcce2c50f9bec120078cb5cf2acf7b6a37e489972309e3e3aab6a55aba2bac70f057d8bde06e25f7c43d1bff0e793edc6eaf0b4e8b5989aef1
@@ -160,12 +160,13 @@ exports.handler = function(event, context, callback) {
160
160
 
161
161
  var request = {
162
162
  _native_req: event,
163
- url: "https://something" + event.path,
163
+ url: "https://" + event.headers.Host + event.path,
164
164
  method: event.httpMethod,
165
165
  params: {}
166
166
  }
167
167
 
168
168
  console.log(request);
169
+ context.callbackWaitsForEmptyEventLoop = false;
169
170
 
170
171
  router(request, callback, function(err) {
171
172
  callback(null, {
data/lib/sumomo/api.rb CHANGED
@@ -143,7 +143,7 @@ module Sumomo
143
143
  body: JSON.stringify(response_object#{pretty_print})
144
144
  };
145
145
 
146
- callback(null, response);
146
+ return callback(null, response);
147
147
  }
148
148
 
149
149
  var retval = function (#{parameter_list}) {
@@ -163,10 +163,13 @@ module Sumomo
163
163
  domain_name,
164
164
  name:,
165
165
  script: nil,
166
+ env: {},
166
167
  dns: nil,
167
168
  cert: nil,
168
169
  mtls_truststore: nil,
169
170
  logging: true,
171
+ network: nil,
172
+ layer: nil,
170
173
  with_statements: [], &block)
171
174
 
172
175
  api = make 'AWS::ApiGateway::RestApi', name: name do
@@ -221,6 +224,9 @@ module Sumomo
221
224
 
222
225
  fun = make_lambda(
223
226
  name: "#{name}Lambda#{@version_number}",
227
+ env: env,
228
+ network: network,
229
+ layer: layer,
224
230
  files: files,
225
231
  role: custom_resource_exec_role(with_statements: with_statements) )
226
232
 
data/lib/sumomo/stack.rb CHANGED
@@ -24,8 +24,11 @@ module Sumomo
24
24
  function_key: "cloudformation/lambda/function_#{name}",
25
25
  handler: 'index.handler',
26
26
  runtime: 'nodejs14.x',
27
+ env: {},
27
28
  memory_size: 128,
28
29
  timeout: 30,
30
+ network: nil,
31
+ layer: nil,
29
32
  enable_logging: true,
30
33
  role: nil)
31
34
 
@@ -45,6 +48,29 @@ module Sumomo
45
48
  end
46
49
  end
47
50
 
51
+ vpcconfig = nil
52
+
53
+ if network != nil
54
+
55
+ layer ||= network.subnets.keys.first
56
+
57
+ ingress = [allow_port(:all)]
58
+ egress = [allow_port(:all)]
59
+
60
+ lambda_sec_group = make 'AWS::EC2::SecurityGroup' do
61
+ GroupDescription "Lambda Security group for layer: #{layer}"
62
+ SecurityGroupIngress ingress
63
+ SecurityGroupEgress egress
64
+ VpcId network.vpc
65
+ end
66
+
67
+ subnetids = network.subnets[layer].map { |x| x[:name] }
68
+ vpcconfig = {
69
+ SecurityGroupIds: [lambda_sec_group],
70
+ SubnetIds: subnetids
71
+ }
72
+ end
73
+
48
74
  @store.set_raw(function_key, stringio.string)
49
75
 
50
76
  stack = self
@@ -58,6 +84,10 @@ module Sumomo
58
84
  Runtime runtime
59
85
  Timeout timeout
60
86
  Role role.Arn
87
+ VpcConfig vpcconfig unless vpcconfig.nil?
88
+ Environment do
89
+ Variables env
90
+ end
61
91
  end
62
92
 
63
93
  if enable_logging
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sumomo
4
- VERSION = '0.8.15'
4
+ VERSION = '0.8.17'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sumomo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.15
4
+ version: 0.8.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Siaw
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-12 00:00:00.000000000 Z
11
+ date: 2022-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler