lamby 0.4.1 → 0.5.0

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
  SHA256:
3
- metadata.gz: b877bf439c4d029f114269bf0997183360141cd56fea79b707f566815b30e127
4
- data.tar.gz: 34c90dc61e682942f5a2f1201a30016f46d2226624f66db420c3c19909ae948b
3
+ metadata.gz: 8013b19c9361fe4a34b96607930c8591e805db0cc22e22a2c490cb95ea711ca7
4
+ data.tar.gz: 89ee1f0256188b82ae65f827c036d75373cb68196a90f32a478e512c31a94a8f
5
5
  SHA512:
6
- metadata.gz: 79c7f99185046f58e6e799b868ddd635b84be4c561d8d702920b88996b0286cc8c28370f0a052105590f95b687f3d5eea5e876c528d92ebea9deeeb09db11781
7
- data.tar.gz: 5726f3cd5e436a3276609b52e23ccd357c397e4984de59c8eaefbec6235f7d6cbd67ceebcdac6a5dbbbdbe4e2a862f13ab8ba43a0982c2f60e04bd97bbf15f2c
6
+ metadata.gz: 6da7008851be7f91d0e967434ef963e7d5d41c006122f4a8801cb8b3217d0504a7a2fcf97d55c4c83aad0f83914a4bb158628be5b749afdf1969e8e3fbd407fc
7
+ data.tar.gz: 1d81577d4640c7fa95b4f32e8aa40600607ac8aa87e395adc2e3c35d049260e2a829d2b77e9321988c77e756b8d7b5c003e93b6cacc4bbedb55ff37f9a59b47a
data/.gitignore CHANGED
@@ -5,3 +5,11 @@
5
5
  /pkg/
6
6
  /spec/reports/
7
7
  /tmp/
8
+ test/dummy_app/.gitignore
9
+ test/dummy_app/app.rb
10
+ test/dummy_app/template.yaml
11
+ test/dummy_app/bin/build
12
+ test/dummy_app/bin/deploy
13
+ test/dummy_app/tmp
14
+ test/dummy_app/log/**/*
15
+ test/dummy_app/public/**/*
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.5.3
1
+ 2.5.5
data/.travis.yml CHANGED
@@ -3,7 +3,7 @@ if: branch = master OR type = pull_request
3
3
  language: ruby
4
4
  cache: bundler
5
5
  rvm:
6
- - 2.5.3
6
+ - 2.5.5
7
7
  before_install:
8
8
  - sudo gem install bundler -v 1.17.3
9
9
  - bin/setup
data/Brewfile CHANGED
@@ -1,6 +1,5 @@
1
- # Add homebrew-based depencencies here
2
- tap "aws/tap"
3
- tap "customink/bootstrap-python"
4
- tap "github/bootstrap"
5
- brew "aws-sam-cli"
6
- cask "docker"
1
+ cask 'docker'
2
+ brew 'zlib'
3
+ brew 'rbenv'
4
+ brew 'pyenv'
5
+ brew 'pipenv'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Keep A Changelog!
2
2
 
3
+ See this http://keepachangelog.com link for information on how we want this documented formatted.
4
+
5
+ ## v0.5.0
6
+
7
+ #### Added
8
+
9
+ * Template generators for first install. Ex: `./bin/rake -r lamby lamby:install:api_gateway`.
10
+ * New `Lamby::SsmParameterStore.get!` helper.
11
+
3
12
 
4
13
  ## v0.4.1
5
14
 
@@ -15,8 +24,6 @@
15
24
  * File uploads in #33 using `CONTENT_TYPE` and `CONTENT_LENGTH`.
16
25
 
17
26
 
18
- See this http://keepachangelog.com link for information on how we want this documented formatted.
19
-
20
27
  ## v0.3.2
21
28
 
22
29
  #### Added
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lamby (0.3.1)
4
+ lamby (0.5.0)
5
5
  rack
6
6
  rails
7
7
 
@@ -63,6 +63,7 @@ GEM
63
63
  aws-sigv4 (1.1.0)
64
64
  aws-eventstream (~> 1.0, >= 1.0.2)
65
65
  builder (3.2.3)
66
+ coderay (1.1.2)
66
67
  concurrent-ruby (1.1.5)
67
68
  crass (1.0.4)
68
69
  erubi (1.8.0)
@@ -87,9 +88,12 @@ GEM
87
88
  mocha (1.8.0)
88
89
  metaclass (~> 0.0.1)
89
90
  nio4r (2.3.1)
90
- nokogiri (1.10.2)
91
+ nokogiri (1.10.3)
91
92
  mini_portile2 (~> 2.4.0)
92
- rack (2.0.6)
93
+ pry (0.12.2)
94
+ coderay (~> 1.1.0)
95
+ method_source (~> 0.9.0)
96
+ rack (2.0.7)
93
97
  rack-test (1.1.0)
94
98
  rack (>= 1.0, < 3)
95
99
  rails (5.2.3)
@@ -124,6 +128,7 @@ GEM
124
128
  actionpack (>= 4.0)
125
129
  activesupport (>= 4.0)
126
130
  sprockets (>= 3.0.0)
131
+ sqlite3 (1.4.1)
127
132
  thor (0.20.3)
128
133
  thread_safe (0.3.6)
129
134
  tzinfo (1.2.5)
@@ -141,7 +146,9 @@ DEPENDENCIES
141
146
  lamby!
142
147
  minitest
143
148
  mocha
149
+ pry
144
150
  rake
151
+ sqlite3
145
152
 
146
153
  BUNDLED WITH
147
154
  1.17.3
data/Pipfile CHANGED
@@ -1,12 +1,13 @@
1
1
  [[source]]
2
+ name = "pypi"
2
3
  url = "https://pypi.org/simple"
3
4
  verify_ssl = true
4
- name = "pypi"
5
-
6
- [packages]
7
5
 
8
6
  [dev-packages]
9
7
 
8
+ [packages]
9
+ awscli = ">=1.16.166"
10
+ aws-sam-cli = ">=0.16.1"
11
+
10
12
  [requires]
11
- python_version = "3.7"
12
- awscli = "*"
13
+ python_version = "3.6.7"
data/Pipfile.lock CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "_meta": {
3
3
  "hash": {
4
- "sha256": "e90ffb3268e39f48a61a46d3b09fe56bb9447190af124f7e6ec4947a6b87873e"
4
+ "sha256": "816a6a878711ca86e9fb35f0e63dbb285cc6a802fb7bfd64492477a7695a6bbd"
5
5
  },
6
6
  "pipfile-spec": 6,
7
7
  "requires": {
8
- "awscli": "*",
9
- "python_version": "3.7"
8
+ "python_version": "3.6.7"
10
9
  },
11
10
  "sources": [
12
11
  {
@@ -16,6 +15,354 @@
16
15
  }
17
16
  ]
18
17
  },
19
- "default": {},
18
+ "default": {
19
+ "arrow": {
20
+ "hashes": [
21
+ "sha256:002f2315cf4c8404de737c42860441732d339bbc57fee584e2027520e055ecc1",
22
+ "sha256:82dd5e13b733787d4eb0fef42d1ee1a99136dc1d65178f70373b3678b3181bfc"
23
+ ],
24
+ "version": "==0.13.2"
25
+ },
26
+ "aws-lambda-builders": {
27
+ "hashes": [
28
+ "sha256:427724b039409a05a706a3f8125cb88c3901527b1192f4da2588714103f68b08",
29
+ "sha256:9222fc6d6ac481bf5fa1849e2ae2b353eb38d310eea76606824c971b39482705",
30
+ "sha256:e7c06c79a9f031a461b00a7241396115cf3e5bed0db0d6c9763cfb2cde7779dd"
31
+ ],
32
+ "version": "==0.3.0"
33
+ },
34
+ "aws-sam-cli": {
35
+ "hashes": [
36
+ "sha256:2dd68800723c76f52980141ba704e105d77469b6ba465781fbc9120e8121e76c",
37
+ "sha256:671fb8032625e560c271021e33b0f8592204025243e951c7bc215847aaa13c68",
38
+ "sha256:7bede6dff854037d49ff223e921d4bd55ff92e2765198df9596e34e254d5a57b"
39
+ ],
40
+ "index": "pypi",
41
+ "version": "==0.16.1"
42
+ },
43
+ "aws-sam-translator": {
44
+ "hashes": [
45
+ "sha256:0e1fa094c6791b233f5e73f2f0803ec6e0622f2320ec5a969f0986855221b92b"
46
+ ],
47
+ "version": "==1.10.0"
48
+ },
49
+ "awscli": {
50
+ "hashes": [
51
+ "sha256:734637607adf6034b0021073dd8582871dba2c97df0df4f443552574390def8e",
52
+ "sha256:a9b8a72f7a07b08be50eda14c4542fd14614aeecb73cf8477f8f92c403406c15"
53
+ ],
54
+ "index": "pypi",
55
+ "version": "==1.16.166"
56
+ },
57
+ "binaryornot": {
58
+ "hashes": [
59
+ "sha256:359501dfc9d40632edc9fac890e19542db1a287bbcfa58175b66658392018061",
60
+ "sha256:b8b71173c917bddcd2c16070412e369c3ed7f0528926f70cac18a6c97fd563e4"
61
+ ],
62
+ "version": "==0.4.4"
63
+ },
64
+ "boto3": {
65
+ "hashes": [
66
+ "sha256:59782c178af2d5acf66315fe96b3cd1dc075109c0296c384e18a6c4143c0745d",
67
+ "sha256:758787b5ad7c5e2aa2979b0671129491fbab00a7b84a26532cd6b9d073ed862b"
68
+ ],
69
+ "version": "==1.9.156"
70
+ },
71
+ "botocore": {
72
+ "hashes": [
73
+ "sha256:00b72bc2104a2f56513bc40ce380d0605262decc9fe3b2ce840da48f257598d7",
74
+ "sha256:a12a817bf1faf36837bc2d371aacfb5c7c324e0e9f0b3af94b9930cfcd8d62ea"
75
+ ],
76
+ "version": "==1.12.156"
77
+ },
78
+ "certifi": {
79
+ "hashes": [
80
+ "sha256:59b7658e26ca9c7339e00f8f4636cdfe59d34fa37b9b04f6f9e9926b3cece1a5",
81
+ "sha256:b26104d6835d1f5e49452a26eb2ff87fe7090b89dfcaee5ea2212697e1e1d7ae"
82
+ ],
83
+ "version": "==2019.3.9"
84
+ },
85
+ "chardet": {
86
+ "hashes": [
87
+ "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae",
88
+ "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691"
89
+ ],
90
+ "version": "==3.0.4"
91
+ },
92
+ "chevron": {
93
+ "hashes": [
94
+ "sha256:95b0a055ef0ada5eb061d60be64a7f70670b53372ccd221d1b88adf1c41a9094",
95
+ "sha256:f95054a8b303268ebf3efd6bdfc8c1b428d3fc92327913b4e236d062ec61c989"
96
+ ],
97
+ "version": "==0.13.1"
98
+ },
99
+ "click": {
100
+ "hashes": [
101
+ "sha256:29f99fc6125fbc931b758dc053b3114e55c77a6e4c6c3a2674a2dc986016381d",
102
+ "sha256:f15516df478d5a56180fbf80e68f206010e6d160fc39fa508b65e035fd75130b"
103
+ ],
104
+ "version": "==6.7"
105
+ },
106
+ "colorama": {
107
+ "hashes": [
108
+ "sha256:463f8483208e921368c9f306094eb6f725c6ca42b0f97e313cb5d5512459feda",
109
+ "sha256:48eb22f4f8461b1df5734a074b57042430fb06e1d61bd1e11b078c0fe6d7a1f1"
110
+ ],
111
+ "version": "==0.3.9"
112
+ },
113
+ "cookiecutter": {
114
+ "hashes": [
115
+ "sha256:1316a52e1c1f08db0c9efbf7d876dbc01463a74b155a0d83e722be88beda9a3e",
116
+ "sha256:ed8f54a8fc79b6864020d773ce11539b5f08e4617f353de1f22d23226f6a0d36"
117
+ ],
118
+ "version": "==1.6.0"
119
+ },
120
+ "dateparser": {
121
+ "hashes": [
122
+ "sha256:42d51be54e74a8e80a4d76d1fa6e4edd997098fce24ad2d94a2eab5ef247193e",
123
+ "sha256:78124c458c461ea7198faa3c038f6381f37588b84bb42740e91a4cbd260b1d09"
124
+ ],
125
+ "version": "==0.7.1"
126
+ },
127
+ "docker": {
128
+ "hashes": [
129
+ "sha256:3db499d4d25847fed86acf8e100c989f7bc0f75a6fff6c52855726ada1d124f6",
130
+ "sha256:f61c37d721b489b7d55ef631b241be2d6a5884c3ffe63dc8f7dd9a3c3cd60489"
131
+ ],
132
+ "version": "==4.0.1"
133
+ },
134
+ "docutils": {
135
+ "hashes": [
136
+ "sha256:02aec4bd92ab067f6ff27a38a38a41173bf01bed8f89157768c1573f53e474a6",
137
+ "sha256:51e64ef2ebfb29cae1faa133b3710143496eca21c530f3f71424d77687764274",
138
+ "sha256:7a4bd47eaf6596e1295ecb11361139febe29b084a87bf005bf899f9a42edc3c6"
139
+ ],
140
+ "version": "==0.14"
141
+ },
142
+ "flask": {
143
+ "hashes": [
144
+ "sha256:ad7c6d841e64296b962296c2c2dabc6543752985727af86a975072dea984b6f3",
145
+ "sha256:e7d32475d1de5facaa55e3958bc4ec66d3762076b074296aa50ef8fdc5b9df61"
146
+ ],
147
+ "version": "==1.0.3"
148
+ },
149
+ "future": {
150
+ "hashes": [
151
+ "sha256:67045236dcfd6816dc439556d009594abf643e5eb48992e36beac09c2ca659b8"
152
+ ],
153
+ "version": "==0.17.1"
154
+ },
155
+ "idna": {
156
+ "hashes": [
157
+ "sha256:156a6814fb5ac1fc6850fb002e0852d56c0c8d2531923a51032d1b70760e186e",
158
+ "sha256:684a38a6f903c1d71d6d5fac066b58d7768af4de2b832e426ec79c30daa94a16"
159
+ ],
160
+ "version": "==2.7"
161
+ },
162
+ "itsdangerous": {
163
+ "hashes": [
164
+ "sha256:321b033d07f2a4136d3ec762eac9f16a10ccd60f53c0c91af90217ace7ba1f19",
165
+ "sha256:b12271b2047cb23eeb98c8b5622e2e5c5e9abd9784a153e9d8ef9cb4dd09d749"
166
+ ],
167
+ "version": "==1.1.0"
168
+ },
169
+ "jinja2": {
170
+ "hashes": [
171
+ "sha256:065c4f02ebe7f7cf559e49ee5a95fb800a9e4528727aec6f24402a5374c65013",
172
+ "sha256:14dd6caf1527abb21f08f86c784eac40853ba93edb79552aa1e4b8aef1b61c7b"
173
+ ],
174
+ "version": "==2.10.1"
175
+ },
176
+ "jinja2-time": {
177
+ "hashes": [
178
+ "sha256:d14eaa4d315e7688daa4969f616f226614350c48730bfa1692d2caebd8c90d40",
179
+ "sha256:d3eab6605e3ec8b7a0863df09cc1d23714908fa61aa6986a845c20ba488b4efa"
180
+ ],
181
+ "version": "==0.2.0"
182
+ },
183
+ "jmespath": {
184
+ "hashes": [
185
+ "sha256:3720a4b1bd659dd2eecad0666459b9788813e032b83e7ba58578e48254e0a0e6",
186
+ "sha256:bde2aef6f44302dfb30320115b17d030798de8c4110e28d5cf6cf91a7a31074c"
187
+ ],
188
+ "version": "==0.9.4"
189
+ },
190
+ "jsonschema": {
191
+ "hashes": [
192
+ "sha256:000e68abd33c972a5248544925a0cae7d1125f9bf6c58280d37546b946769a08",
193
+ "sha256:6ff5f3180870836cae40f06fa10419f557208175f13ad7bc26caa77beb1f6e02"
194
+ ],
195
+ "version": "==2.6.0"
196
+ },
197
+ "markupsafe": {
198
+ "hashes": [
199
+ "sha256:00bc623926325b26bb9605ae9eae8a215691f33cae5df11ca5424f06f2d1f473",
200
+ "sha256:09027a7803a62ca78792ad89403b1b7a73a01c8cb65909cd876f7fcebd79b161",
201
+ "sha256:09c4b7f37d6c648cb13f9230d847adf22f8171b1ccc4d5682398e77f40309235",
202
+ "sha256:1027c282dad077d0bae18be6794e6b6b8c91d58ed8a8d89a89d59693b9131db5",
203
+ "sha256:24982cc2533820871eba85ba648cd53d8623687ff11cbb805be4ff7b4c971aff",
204
+ "sha256:29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b",
205
+ "sha256:43a55c2930bbc139570ac2452adf3d70cdbb3cfe5912c71cdce1c2c6bbd9c5d1",
206
+ "sha256:46c99d2de99945ec5cb54f23c8cd5689f6d7177305ebff350a58ce5f8de1669e",
207
+ "sha256:500d4957e52ddc3351cabf489e79c91c17f6e0899158447047588650b5e69183",
208
+ "sha256:535f6fc4d397c1563d08b88e485c3496cf5784e927af890fb3c3aac7f933ec66",
209
+ "sha256:62fe6c95e3ec8a7fad637b7f3d372c15ec1caa01ab47926cfdf7a75b40e0eac1",
210
+ "sha256:6dd73240d2af64df90aa7c4e7481e23825ea70af4b4922f8ede5b9e35f78a3b1",
211
+ "sha256:717ba8fe3ae9cc0006d7c451f0bb265ee07739daf76355d06366154ee68d221e",
212
+ "sha256:79855e1c5b8da654cf486b830bd42c06e8780cea587384cf6545b7d9ac013a0b",
213
+ "sha256:7c1699dfe0cf8ff607dbdcc1e9b9af1755371f92a68f706051cc8c37d447c905",
214
+ "sha256:88e5fcfb52ee7b911e8bb6d6aa2fd21fbecc674eadd44118a9cc3863f938e735",
215
+ "sha256:8defac2f2ccd6805ebf65f5eeb132adcf2ab57aa11fdf4c0dd5169a004710e7d",
216
+ "sha256:98c7086708b163d425c67c7a91bad6e466bb99d797aa64f965e9d25c12111a5e",
217
+ "sha256:9add70b36c5666a2ed02b43b335fe19002ee5235efd4b8a89bfcf9005bebac0d",
218
+ "sha256:9bf40443012702a1d2070043cb6291650a0841ece432556f784f004937f0f32c",
219
+ "sha256:ade5e387d2ad0d7ebf59146cc00c8044acbd863725f887353a10df825fc8ae21",
220
+ "sha256:b00c1de48212e4cc9603895652c5c410df699856a2853135b3967591e4beebc2",
221
+ "sha256:b1282f8c00509d99fef04d8ba936b156d419be841854fe901d8ae224c59f0be5",
222
+ "sha256:b2051432115498d3562c084a49bba65d97cf251f5a331c64a12ee7e04dacc51b",
223
+ "sha256:ba59edeaa2fc6114428f1637ffff42da1e311e29382d81b339c1817d37ec93c6",
224
+ "sha256:c8716a48d94b06bb3b2524c2b77e055fb313aeb4ea620c8dd03a105574ba704f",
225
+ "sha256:cd5df75523866410809ca100dc9681e301e3c27567cf498077e8551b6d20e42f",
226
+ "sha256:e249096428b3ae81b08327a63a485ad0878de3fb939049038579ac0ef61e17e7"
227
+ ],
228
+ "version": "==1.1.1"
229
+ },
230
+ "poyo": {
231
+ "hashes": [
232
+ "sha256:c34a5413191210ed564640510e9c4a4ba3b698746d6b454d46eb5bfb30edcd1d",
233
+ "sha256:d1c317054145a6b1ca0608b5e676b943ddc3bfd671f886a2fe09288b98221edb"
234
+ ],
235
+ "version": "==0.4.2"
236
+ },
237
+ "pyasn1": {
238
+ "hashes": [
239
+ "sha256:da2420fe13a9452d8ae97a0e478adde1dee153b11ba832a95b223a2ba01c10f7",
240
+ "sha256:da6b43a8c9ae93bc80e2739efb38cc776ba74a886e3e9318d65fe81a8b8a2c6e"
241
+ ],
242
+ "version": "==0.4.5"
243
+ },
244
+ "python-dateutil": {
245
+ "hashes": [
246
+ "sha256:7e6584c74aeed623791615e26efd690f29817a27c73085b78e4bad02493df2fb",
247
+ "sha256:c89805f6f4d64db21ed966fda138f8a5ed7a4fdbc1a8ee329ce1b74e3c74da9e"
248
+ ],
249
+ "markers": "python_version >= '2.7'",
250
+ "version": "==2.8.0"
251
+ },
252
+ "pytz": {
253
+ "hashes": [
254
+ "sha256:303879e36b721603cc54604edcac9d20401bdbe31e1e4fdee5b9f98d5d31dfda",
255
+ "sha256:d747dd3d23d77ef44c6a3526e274af6efeb0a6f1afd5a69ba4d5be4098c8e141"
256
+ ],
257
+ "version": "==2019.1"
258
+ },
259
+ "pyyaml": {
260
+ "hashes": [
261
+ "sha256:3d7da3009c0f3e783b2c873687652d83b1bbfd5c88e9813fb7e5b03c0dd3108b",
262
+ "sha256:3ef3092145e9b70e3ddd2c7ad59bdd0252a94dfe3949721633e41344de00a6bf",
263
+ "sha256:40c71b8e076d0550b2e6380bada1f1cd1017b882f7e16f09a65be98e017f211a",
264
+ "sha256:558dd60b890ba8fd982e05941927a3911dc409a63dcb8b634feaa0cda69330d3",
265
+ "sha256:a7c28b45d9f99102fa092bb213aa12e0aaf9a6a1f5e395d36166639c1f96c3a1",
266
+ "sha256:aa7dd4a6a427aed7df6fb7f08a580d68d9b118d90310374716ae90b710280af1",
267
+ "sha256:bc558586e6045763782014934bfaf39d48b8ae85a2713117d16c39864085c613",
268
+ "sha256:d46d7982b62e0729ad0175a9bc7e10a566fc07b224d2c79fafb5e032727eaa04",
269
+ "sha256:d5eef459e30b09f5a098b9cea68bebfeb268697f78d647bd255a085371ac7f3f",
270
+ "sha256:e01d3203230e1786cd91ccfdc8f8454c8069c91bee3962ad93b87a4b2860f537",
271
+ "sha256:e170a9e6fcfd19021dd29845af83bb79236068bf5fd4df3327c1be18182b2531"
272
+ ],
273
+ "version": "==3.13"
274
+ },
275
+ "regex": {
276
+ "hashes": [
277
+ "sha256:0ac2ba14f1e069507eec395140c0701045340f386a7ee7adb95961b3a2d821ef",
278
+ "sha256:3b90bfb577ba7ff2c25f74496096e8c2a92007b4c32108a7076d3b33a92ab357",
279
+ "sha256:455f29e0ad4a8002aed6a6c00c8054441dde03e25b1d622568afddb251439f14",
280
+ "sha256:6b957a06533fa7f070d339c1399fcc739d8b9b08f9d82c768e19bcf2b5cf5427",
281
+ "sha256:6fe1dd1d522062912e18d08f1ddd508431fdad7af2ebd80e035d74a1953e9e6a",
282
+ "sha256:7e3f1cbdd4d38dade6c880551fe7c2a2832635c743d9c8993785714615d7c08d",
283
+ "sha256:81f13830915fb3fe88d49e896a99a25eeb62dc1f3808c77bf3588fe8cdfcadc5",
284
+ "sha256:a5b17c52ce57657459162fb414f2ff8b85b7212921281ffe1ca63fb4105bee24",
285
+ "sha256:cc4dcdb1ee6fcb7d6a0b6eff4d86cb203b5b082719c94c88b7d7175c13691f92"
286
+ ],
287
+ "version": "==2019.5.25"
288
+ },
289
+ "requests": {
290
+ "hashes": [
291
+ "sha256:65b3a120e4329e33c9889db89c80976c5272f56ea92d3e74da8a463992e3ff54",
292
+ "sha256:ea881206e59f41dbd0bd445437d792e43906703fff75ca8ff43ccdb11f33f263"
293
+ ],
294
+ "version": "==2.20.1"
295
+ },
296
+ "rsa": {
297
+ "hashes": [
298
+ "sha256:25df4e10c263fb88b5ace923dd84bf9aa7f5019687b5e55382ffcdb8bede9db5",
299
+ "sha256:43f682fea81c452c98d09fc316aae12de6d30c4b5c84226642cf8f8fd1c93abd"
300
+ ],
301
+ "version": "==3.4.2"
302
+ },
303
+ "s3transfer": {
304
+ "hashes": [
305
+ "sha256:7b9ad3213bff7d357f888e0fab5101b56fa1a0548ee77d121c3a3dbfbef4cb2e",
306
+ "sha256:f23d5cb7d862b104401d9021fc82e5fa0e0cf57b7660a1331425aab0c691d021"
307
+ ],
308
+ "version": "==0.2.0"
309
+ },
310
+ "serverlessrepo": {
311
+ "hashes": [
312
+ "sha256:533389d41a51450e50cc01405ab766550170149c08e1c85b3a1559b0fab4cb25",
313
+ "sha256:d40e83d29175ba3eddaa02f1dac57332d1dec495e012cd2e80366be9ad7c94a5"
314
+ ],
315
+ "version": "==0.1.8"
316
+ },
317
+ "six": {
318
+ "hashes": [
319
+ "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9",
320
+ "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb"
321
+ ],
322
+ "version": "==1.11.0"
323
+ },
324
+ "tzlocal": {
325
+ "hashes": [
326
+ "sha256:4ebeb848845ac898da6519b9b31879cf13b6626f7184c496037b818e238f2c4e"
327
+ ],
328
+ "version": "==1.5.1"
329
+ },
330
+ "urllib3": {
331
+ "hashes": [
332
+ "sha256:2393a695cd12afedd0dcb26fe5d50d0cf248e5a66f75dbd89a3d4eb333a61af4",
333
+ "sha256:a637e5fae88995b256e3409dc4d52c2e2e0ba32c42a6365fee8bbd2238de3cfb"
334
+ ],
335
+ "markers": "python_version >= '3.4'",
336
+ "version": "==1.24.3"
337
+ },
338
+ "websocket-client": {
339
+ "hashes": [
340
+ "sha256:1151d5fb3a62dc129164292e1227655e4bbc5dd5340a5165dfae61128ec50aa9",
341
+ "sha256:1fd5520878b68b84b5748bb30e592b10d0a91529d5383f74f4964e72b297fd3a"
342
+ ],
343
+ "version": "==0.56.0"
344
+ },
345
+ "werkzeug": {
346
+ "hashes": [
347
+ "sha256:865856ebb55c4dcd0630cdd8f3331a1847a819dda7e8c750d3db6f2aa6c0209c",
348
+ "sha256:a0b915f0815982fb2a09161cb8f31708052d0951c3ba433ccc5e1aa276507ca6"
349
+ ],
350
+ "version": "==0.15.4"
351
+ },
352
+ "wheel": {
353
+ "hashes": [
354
+ "sha256:5e79117472686ac0c4aef5bad5172ea73a1c2d1646b808c35926bd26bdfb0c08",
355
+ "sha256:62fcfa03d45b5b722539ccbc07b190e4bfff4bb9e3a4d470dd9f6a0981002565"
356
+ ],
357
+ "version": "==0.33.4"
358
+ },
359
+ "whichcraft": {
360
+ "hashes": [
361
+ "sha256:7533870f751901a0ce43c93cc9850186e9eba7fe58c924dfb435968ba9c9fa4e",
362
+ "sha256:fecddd531f237ffc5db8b215409afb18fa30300699064cca4817521b4fc81815"
363
+ ],
364
+ "version": "==0.5.2"
365
+ }
366
+ },
20
367
  "develop": {}
21
368
  }
data/README.md CHANGED
@@ -14,61 +14,105 @@ end
14
14
 
15
15
  ## Getting Started
16
16
 
17
- #### Add The Gem
17
+ A simple Hello Rails application example using Lamby.
18
+
19
+ #### Installing AWS CLI & SAM
20
+
21
+ This is fairly easy on Macs using Homebrew. For other platforms or first time installers, please follow the [full guides](https://github.com/customink/lamby/issues/18) and configure your AWS CLI before proceeding.
22
+
23
+ ```shell
24
+ $ brew install awscli
25
+ $ brew tap aws/tap
26
+ $ brew install aws-sam-cli
27
+ ```
28
+
29
+ #### New Rails Application
30
+
31
+ Lamby works with existing Rails projects. In theory, any version. In our getting started example, let's create a new application. Here we skip any frameworks not needed, notable ActiveRecord.
32
+
33
+ ```shell
34
+ $ rbenv local 2.5.5
35
+ $ gem install rails -v 6.0.0.rc1
36
+ $ rails new my_awesome_lambda \
37
+ --skip-action-mailer --skip-action-mailbox --skip-action-text \
38
+ --skip-active-record --skip-active-storage --skip-puma \
39
+ --skip-action-cable --skip-spring --skip-listen --skip-turbolinks \
40
+ --skip-system-test --skip-bootsnap --skip-webpack-install
41
+ $ cd my_awesome_lambda
42
+ ```
18
43
 
19
- Add the Lamby gem to your Rails project's `Gemfile`. Recommend only requiring Lamby in your `app.rb` so your local development or test logs still work.
44
+ Add a root to the `routes.rb` file which maps to an `index` action in the application controller and return a simple Hello Rails H1 tag.
20
45
 
21
46
  ```ruby
22
- gem 'lamby', require: false
47
+ Rails.application.routes.draw do
48
+ root to: 'application#index'
49
+ end
50
+
51
+ class ApplicationController < ActionController::Base
52
+ def index
53
+ render html: '<h1>Hello Rails</h1>'.html_safe
54
+ end
55
+ end
23
56
  ```
24
57
 
25
- #### Create Handler
58
+ #### Add The Gem
26
59
 
27
- Create an `app.rb` file that will be the source for the Lambda's handler. Example:
60
+ Add the Lamby gem to your Rails project's `Gemfile`. Recommend only requiring Lamby in your `app.rb` so your local development or test environment logs still work.
28
61
 
29
62
  ```ruby
30
- require_relative 'config/boot'
31
- require 'lamby'
32
- require_relative 'config/application'
33
- require_relative 'config/environment'
63
+ gem 'lamby', require: false
64
+ gem 'aws-sdk-ssm'
65
+ ```
34
66
 
35
- $app = Rack::Builder.new { run Rails.application }.to_app
67
+ #### Install Needed Files
36
68
 
37
- def handler(event:, context:)
38
- Lamby.handler $app, event, context
39
- end
69
+ Lamby provides a simple Rake task to install the files needed for AWS Lambda to run your application.
70
+
71
+ ```shell
72
+ $ ./bin/rake -r lamby lamby:install:api_gateway
40
73
  ```
41
74
 
42
- #### Create SAM Template
75
+ This will install the following files.
43
76
 
44
- Create an [AWS SAM](https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md) `template.yaml` file that expresses your function's resources and how it receives events from API Gateway. Please use this full [doc/template.yaml](doc/template.yaml) file hosted here as a starting point. The basic template accomplishes the following.
77
+ * `app.rb` - Entry point for the Lambda handler.
78
+ * `template.yaml` - Your AWS Serverless Application Model ([SAM](https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md)) template.
79
+ * `bin/build` - Configurable bash script to build your project with SAM.
80
+ * `bin/deploy` - Configurable bash script to deploy your app to with SAM.
45
81
 
46
- * Defines a `RailsEnv` input parameter.
47
- - Applies this to the `RAILS_ENV` environment variable.
48
- * Creates a API Gateway resource named `RailsApi`.
49
- - Ensures that the stage name is set to the Rails env.
50
- - Using inline Swagger, define a root `/` via GET and greedy proxy `/{resource+}` via ANY.
51
- - Allow any binary media type to be a valid response.
52
- * Creates a Lambda function resource named `RailsFunction`.
53
- - Sets the handler to `app.handler`. File above.
54
- - Defines events from API above for both root and greedy proxy.
55
- * Simple `Outputs` that echos the resources you created.
82
+ #### Create CloudFormation S3 Bucket
83
+
84
+ The default name for the bucket in the `deploy` script would include your computer's username. You can change this in your script (WHICH WE RECOMMEND) or use the `CLOUDFORMATION_BUCKET` environment varable. Assuming you stick with the default:
85
+
86
+ ```shell
87
+ aws s3 mb "s3://lamby.cloudformation.$(whoami)"
88
+ ```
56
89
 
57
- #### Git Ignores
90
+ #### Configuration
58
91
 
59
- Ensure both `/.aws-sam` and `/vendor/bundle` are added to `.gitignore`. AWS SAM uses the `.aws-sam` directory to build your project. No file there should be committed to source control.
92
+ We recommend using [Rails Credentials](https://guides.rubyonrails.org/security.html#environmental-security) by setting the `RAILS_MASTER_KEY` environment variable in your `app.rb` file. The value be read from AWS Systems Manager [Parameter Store](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-paramstore.html) which Lamby has a client wrapper for. To set that value, use the following AWS CLI command.
60
93
 
61
94
  ```shell
62
- $ echo '/.aws-sam' >> .gitignore
63
- $ echo '/vendor/bundle' >> .gitignore
95
+ aws ssm put-parameter \
96
+ --name "/config/my_awesome_lambda/env/RAILS_MASTER_KEY" \
97
+ --type "SecureString" \
98
+ --value $(cat config/master.key)
64
99
  ```
65
100
 
66
- #### Get Running
101
+ Update your `app.rb` file and add this line right after `require 'lamby'`.
67
102
 
68
- To run your Lambda locally or deploy it, please read the following docs.
103
+ ```ruby
104
+ ENV['RAILS_MASTER_KEY'] =
105
+ Lamby::SsmParameterStore.get!('/config/my_awesome_lambda/env/RAILS_MASTER_KEY')
106
+ ```
107
+
108
+ #### First Deploy!
109
+
110
+ Now your Rails app is ready to be deployed to AWS Lambda via CloudFormation & SAM.
111
+
112
+ ```shell
113
+ $ ./bin/deploy
114
+ ```
69
115
 
70
- * [Installing AWS CLI and AWS SAM](https://github.com/customink/lamby/issues/18)
71
- * [Bin Scripts - Setup, Build, Server, & Deploy](https://github.com/customink/lamby/issues/17)
72
116
 
73
117
  ## Additional Documentation
74
118
 
data/bin/bootstrap CHANGED
@@ -1,31 +1,20 @@
1
- #!/usr/bin/env bash
1
+ #!/bin/bash
2
2
 
3
3
  set -e
4
4
 
5
- cd "$(dirname "$0")/.."
6
-
7
5
  if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then
8
6
  brew bundle check || {
9
7
  echo "==> Installing Homebrew dependencies..."
10
8
  brew bundle --verbose
11
9
  }
12
- else
13
- echo "Skipping because bootstrap is currently macOS depentant."
14
- exit 1
15
10
  fi
16
11
 
17
- echo "==> Setting up python..."
18
- if [ "$(which pyenv)" != "" ] && [ "$(which pipenv)" != "" ]; then
19
- brew bootstrap-pyenv-python
20
- else
21
- echo "Skipping because pyenv/pipenv were not found."
22
- exit 1;
23
- fi
12
+ rbenv install \
13
+ --skip-existing \
14
+ $(cat .ruby-version)
24
15
 
25
- echo "==> Setting up ruby..."
26
- if [ "$(which rbenv)" != "" ] && [ "$(which ruby-build)" != "" ]; then
27
- brew bootstrap-rbenv-ruby
28
- else
29
- echo "Skipping because rbenv/ruby-build were not found."
30
- exit 1;
31
- fi
16
+ CFLAGS="-I$(brew --prefix zlib)/include" \
17
+ LDFLAGS="-L$(brew --prefix zlib)/lib" \
18
+ pyenv install \
19
+ --skip-existing \
20
+ $(cat .python-version)
data/bin/setup CHANGED
@@ -1,13 +1,7 @@
1
- #!/usr/bin/env bash
1
+ #!/bin/bash
2
2
 
3
- set -euo pipefail
4
- IFS=$'\n\t'
5
- set -vx
3
+ set -e
6
4
 
7
5
  bundle install
8
6
 
9
- if [ "$(pipenv --version)" != "" ]; then
10
- pipenv install
11
- else
12
- echo "WARNING: pipenv not found in \$PATH. Skipping pipenv install"
13
- fi
7
+ pipenv install
data/bin/update ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+
3
+ set -e
4
+
5
+ pipenv --rm
6
+
7
+ ./bin/setup
data/lamby.gemspec CHANGED
@@ -25,4 +25,6 @@ Gem::Specification.new do |spec|
25
25
  spec.add_development_dependency 'rake'
26
26
  spec.add_development_dependency 'minitest'
27
27
  spec.add_development_dependency 'mocha'
28
+ spec.add_development_dependency 'pry'
29
+ spec.add_development_dependency 'sqlite3'
28
30
  end
data/lib/lamby/railtie.rb CHANGED
@@ -5,6 +5,7 @@ module Lamby
5
5
 
6
6
  rake_tasks do
7
7
  load 'lamby/tasks.rake'
8
+ load 'lamby/templates.rake'
8
9
  end
9
10
 
10
11
  end
@@ -15,6 +15,15 @@ module Lamby
15
15
  new(path).get!.to_dotenv
16
16
  end
17
17
 
18
+ def get!(path)
19
+ parts = path.from(1).split('/')
20
+ env = parts.pop
21
+ path = "/#{parts.join('/')}"
22
+ new(path).get!.params.detect do |p|
23
+ p.env == env
24
+ end.try(:value)
25
+ end
26
+
18
27
  end
19
28
 
20
29
  def initialize(path, options = {})
@@ -0,0 +1,37 @@
1
+ installers = {
2
+ 'API Gateway': :api_gateway
3
+ }.freeze
4
+
5
+ namespace :lamby do
6
+ namespace :install do
7
+
8
+ installers.each do |name, task_name|
9
+ desc "Install Lamby files for #{name}"
10
+ task task_name do
11
+ exec "#{base_path} LOCATION=#{template(task_name)}"
12
+ end
13
+ end
14
+
15
+ def template(task_name)
16
+ File.expand_path "../lamby/templates/#{task_name}.rb", __dir__
17
+ end
18
+
19
+ def bin_path
20
+ ENV['BUNDLE_BIN'] || './bin'
21
+ end
22
+
23
+ def base_path
24
+ if Rails::VERSION::MAJOR >= 5
25
+ "#{RbConfig.ruby} #{bin_path}/rails app:template"
26
+ else
27
+ "#{RbConfig.ruby} #{bin_path}/rake rails:template"
28
+ end
29
+ end
30
+
31
+ end
32
+
33
+ desc "Install Lamby files for #{installers.first.first}"
34
+ task install: 'install:api_gateway'
35
+ end
36
+
37
+
@@ -0,0 +1,25 @@
1
+ $LAMBY_INSTALLER_NAME = 'api_gateway'
2
+ load 'lamby/templates/shared.rb'
3
+
4
+ say '==> Running Lamby API Gateway installer...'
5
+
6
+ say 'Copying files...'
7
+ copy_file tpl_file('app.rb'), app_file('app.rb')
8
+ copy_file tpl_file('template.yaml'), app_file('template.yaml')
9
+ gsub_file app_file('template.yaml'), /APPNAMEHERE/, appname
10
+
11
+ say 'Adding to .gitignore...'
12
+ FileUtils.touch app_file('.gitignore')
13
+ append_to_file app_file('.gitignore'), <<-GITIGNORE.strip_heredoc
14
+ # Lamby
15
+ '/.aws-sam'
16
+ GITIGNORE
17
+
18
+ say 'Creating ./bin files for build and deploy...'
19
+ copy_file shr_file('build'), app_file('bin/build')
20
+ chmod app_file('bin/build'), 0755
21
+ copy_file shr_file('deploy'), app_file('bin/deploy')
22
+ chmod app_file('bin/deploy'), 0755
23
+ gsub_file app_file('bin/deploy'), /APPNAMEHERE/, appname.downcase
24
+
25
+ say 'Welcome to AWS Lambda and Rails 🎉', :green
@@ -0,0 +1,10 @@
1
+ require_relative 'config/boot'
2
+ require 'lamby'
3
+ require_relative 'config/application'
4
+ require_relative 'config/environment'
5
+
6
+ $app = Rack::Builder.new { run Rails.application }.to_app
7
+
8
+ def handler(event:, context:)
9
+ Lamby.handler $app, event, context
10
+ end
@@ -1,15 +1,13 @@
1
1
  AWSTemplateFormatVersion: '2010-09-09'
2
2
  Transform: AWS::Serverless-2016-10-31
3
- Description: Hello Rails Lambda
3
+ Description: APPNAMEHERE Lambda
4
4
 
5
5
  Parameters:
6
6
 
7
7
  RailsEnv:
8
8
  Type: String
9
- Default: development
9
+ Default: production
10
10
  AllowedValues:
11
- - development
12
- - test
13
11
  - staging
14
12
  - production
15
13
 
@@ -82,5 +80,5 @@ Outputs:
82
80
  Value: !Sub "https://${RailsApi}.execute-api.${AWS::Region}.amazonaws.com/${RailsEnv}/"
83
81
 
84
82
  RailsFunctionArn:
85
- Description: Lambda Function ARN
83
+ Description: Lambda ARN
86
84
  Value: !GetAtt RailsFunction.Arn
@@ -0,0 +1,19 @@
1
+ def inst_name
2
+ $LAMBY_INSTALLER_NAME
3
+ end
4
+
5
+ def app_file(path)
6
+ Rails.root.join(path)
7
+ end
8
+
9
+ def tpl_file(path)
10
+ "#{__dir__}/#{inst_name}/#{path}"
11
+ end
12
+
13
+ def shr_file(path)
14
+ "#{__dir__}/shared/#{path}"
15
+ end
16
+
17
+ def appname
18
+ Rails.application.class.parent.name
19
+ end
@@ -0,0 +1,23 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ # Clean any previous bundle/builds.
5
+ rm -rf ./.aws-sam/build
6
+
7
+ # Ensure native extensions built for platform.
8
+ sam build --use-container
9
+
10
+ # [HOOK] Environments & Configuration
11
+ # https://github.com/customink/lamby/issues/28
12
+
13
+ # [HOOK] Asset Hosts & Precompiling
14
+ # https://github.com/customink/lamby/issues/29
15
+
16
+ # Clean un-needed artifacts.
17
+ pushd ./.aws-sam/build/RailsFunction/
18
+ rm -rf .aws-sam \
19
+ .git \
20
+ log \
21
+ test \
22
+ tmp
23
+ popd
@@ -0,0 +1,22 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ export RAILS_ENV=${RAILS_ENV:="production"}
5
+ export AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION:=us-east-1}
6
+ export CLOUDFORMATION_BUCKET=${CLOUDFORMATION_BUCKET:="lamby.cloudformation.$(whoami)"}
7
+
8
+ ./bin/build
9
+
10
+ sam package \
11
+ --region ${AWS_DEFAULT_REGION} \
12
+ --template-file ./.aws-sam/build/template.yaml \
13
+ --output-template-file ./.aws-sam/build/packaged.yaml \
14
+ --s3-bucket $CLOUDFORMATION_BUCKET \
15
+ --s3-prefix "APPNAMEHERE-${RAILS_ENV}"
16
+
17
+ sam deploy \
18
+ --template-file ./.aws-sam/build/packaged.yaml \
19
+ --stack-name "APPNAMEHERE-${RAILS_ENV}-${AWS_DEFAULT_REGION}" \
20
+ --capabilities "CAPABILITY_IAM" \
21
+ --parameter-overrides \
22
+ RailsEnv=${RAILS_ENV}
data/lib/lamby/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lamby
2
- VERSION = '0.4.1'
2
+ VERSION = '0.5.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lamby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Collins
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-05-10 00:00:00.000000000 Z
11
+ date: 2019-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -108,6 +108,34 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: pry
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: sqlite3
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
111
139
  description: Simple Rails & AWS Lambda Integration using Rack and various utilities.
112
140
  email:
113
141
  - kcollins@customink.com
@@ -133,7 +161,7 @@ files:
133
161
  - bin/console
134
162
  - bin/setup
135
163
  - bin/test
136
- - doc/template.yaml
164
+ - bin/update
137
165
  - lamby.gemspec
138
166
  - lib/lamby.rb
139
167
  - lib/lamby/debug.rb
@@ -144,6 +172,13 @@ files:
144
172
  - lib/lamby/sam_helpers.rb
145
173
  - lib/lamby/ssm_parameter_store.rb
146
174
  - lib/lamby/tasks.rake
175
+ - lib/lamby/templates.rake
176
+ - lib/lamby/templates/api_gateway.rb
177
+ - lib/lamby/templates/api_gateway/app.rb
178
+ - lib/lamby/templates/api_gateway/template.yaml
179
+ - lib/lamby/templates/shared.rb
180
+ - lib/lamby/templates/shared/build
181
+ - lib/lamby/templates/shared/deploy
147
182
  - lib/lamby/version.rb
148
183
  homepage: https://github.com/customink/lamby
149
184
  licenses:
@@ -165,7 +200,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
165
200
  version: '0'
166
201
  requirements: []
167
202
  rubyforge_project:
168
- rubygems_version: 2.7.6
203
+ rubygems_version: 2.7.6.2
169
204
  signing_key:
170
205
  specification_version: 4
171
206
  summary: Simple Rails & AWS Lambda Integration using Rack