sumomo 0.8.15 → 0.8.16

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: 4b360df868147cde0facdac9c5ff2f76944db409ce8eb0fd8b0e9e4544b8d3fb
4
+ data.tar.gz: 720f37705fc0f3d7f7555c3f9465229ed50472b75350671a6a163e2084fa9f94
5
5
  SHA512:
6
- metadata.gz: ea85e42594b8bd2c22396d9904277b97307256335f1a2a95c397ecd5cde7b90a2fdbd4a909576080d5e371c2d7130c7c5f3043d6e0086d7a8fbd965b6e7ad700
7
- data.tar.gz: f963dd40b6a1ba5a4de069310d6c44e1d55254008093bbc7933ad37096e797b8a10faabc0936b6c591f6bea85a9ac80bb9f3862b33315b8bc7825c5921dd64ac
6
+ metadata.gz: 397367ad6b32f8a982e22e7c4d43fa111e152c676a49f4b0fe328aab5ac865be88cb22c9a8c8b67a103f70e2a48dc3576c1e9ad38f848b25b328bae9bd1bf47c
7
+ data.tar.gz: 455ae961e13af305fcc9f3b4ac29036837fa39c97a2cf8c8ec9bcaf190bd1bb7cd7b94ef9d564d57feef5d647e0fc7796f5178b7cf479d96b3afeaf42256131e
data/lib/sumomo/api.rb CHANGED
@@ -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.16'
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.16
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-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler