jets 1.5.4 → 1.5.5

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: 409b1640766c778fd1f82e4908636aa9fe44e3d8f174eee18ce143c97f04b63c
4
- data.tar.gz: a451911e27f40e6ba0ae0daacf16112602b16dad128a776592467b9f900a4f63
3
+ metadata.gz: dfde14902f5b9c192e521369854a5f2a2a22107bd76db0ea3f477ac31c4c7079
4
+ data.tar.gz: 14db8a09cd677052bd696a7e87c5ba22eec569a97d19c904e52e9119506ff59b
5
5
  SHA512:
6
- metadata.gz: ed233926d5d210e17d24dca768dffe47a432f338dbd75132a7308251d79309879b932dd96a52e6be52a472700f8e51963514c23b7a9e077f9f34f1f7acbd86ec
7
- data.tar.gz: 405b7a50ad0c5002958de5d4dc236aca0adedd1dbb2cad231ab00806f43e18871bc4d5b52b21eb8c2b1c06b98f7fc56e917b70ebb66b9d8687c6d77a11f3bd71
6
+ metadata.gz: 22b61b236b64743f6d95f4c5fde3232af3314676165175df8f0bbbf6b2bce3f1d0d2c400f2ef6550e766793b769019e559fe8e7354471a70ed926b6580345ce4
7
+ data.tar.gz: a4b5aa4194e32058b749cd94a4b12ee09b10ce47641d11aa128d902d784c877965308b954e17dc549b6d667508f4a32b549971b3145a2240676a69a411850d2b
@@ -16,9 +16,9 @@ Make our lives easier! Choose one of the following by uncommenting it:
16
16
  Before you submit this pull request, make sure to have a look at the following checklist. If you don't know how to do some of these, that's fine! Submit your pull request and we will help you out on the way.
17
17
  -->
18
18
 
19
- - [] I've added tests (if it's a bug, feature or enhancement)
20
- - [] I've adjusted the documentation (if it's a feature or enhancement)
21
- - [] The test suite passes (run `bundle exec rspec` to verify this)
19
+ - [ ] I've added tests (if it's a bug, feature or enhancement)
20
+ - [ ] I've adjusted the documentation (if it's a feature or enhancement)
21
+ - [ ] The test suite passes (run `bundle exec rspec` to verify this)
22
22
 
23
23
  ## Summary
24
24
 
data/CHANGELOG.md CHANGED
@@ -3,6 +3,9 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [1.5.5]
7
+ - #148 check reserved lambda variables and let user know
8
+
6
9
  ## [1.5.4]
7
10
  - #146 add and point to helpful docs on deploy error
8
11
  - #147 update turbo Gemfile.lock, fixes Jets afterburner when using custom layers
data/Gemfile.lock CHANGED
@@ -11,7 +11,7 @@ GIT
11
11
  PATH
12
12
  remote: .
13
13
  specs:
14
- jets (1.5.4)
14
+ jets (1.5.5)
15
15
  activerecord (>= 5.2.1)
16
16
  activesupport (>= 5.2.1)
17
17
  aws-sdk-apigateway
@@ -3,6 +3,7 @@ class Jets::Resource::Lambda::Function
3
3
  def env_properties
4
4
  env_vars = Jets::Dotenv.load!(true)
5
5
  variables = environment.merge(env_vars)
6
+ check_reserved_variables!(variables)
6
7
  {environment: { variables: variables }}
7
8
  end
8
9
 
@@ -20,5 +21,41 @@ class Jets::Resource::Lambda::Function
20
21
  env[:JETS_STAGE] = Jets::Resource::ApiGateway::Deployment.stage_name
21
22
  env
22
23
  end
24
+
25
+ private
26
+ def check_reserved_variables!(variables)
27
+ found_reserved_vars = variables.keys & reserved_variables
28
+ return if found_reserved_vars.empty?
29
+
30
+ puts "You have configured some environment variables that are reserved by AWS Lambda.".colorize(:red)
31
+ puts found_reserved_vars
32
+ puts "The deployment to AWS Lambda will failed when using reserved variables."
33
+ puts "Please remove these reserved variables. "
34
+ puts "More info: https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html#lambda-environment-variables"
35
+ exit 1
36
+ end
37
+
38
+ # https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html#lambda-environment-variables
39
+ def reserved_variables
40
+ %w[
41
+ _HANDLER
42
+ AWS_REGION
43
+ AWS_EXECUTION_ENV
44
+ AWS_LAMBDA_FUNCTION_NAME
45
+ AWS_LAMBDA_FUNCTION_MEMORY_SIZE
46
+ AWS_LAMBDA_FUNCTION_VERSION
47
+ AWS_LAMBDA_LOG_GROUP_NAME
48
+ AWS_LAMBDA_LOG_STREAM_NAME
49
+ AWS_ACCESS_KEY_ID
50
+ AWS_SECRET_ACCESS_KEY
51
+ AWS_SESSION_TOKEN
52
+ TZ
53
+ LAMBDA_TASK_ROOT
54
+ LAMBDA_RUNTIME_DIR
55
+ AWS_LAMBDA_RUNTIME_API
56
+ ]
57
+ end
58
+
59
+
23
60
  end
24
61
  end
data/lib/jets/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jets
2
- VERSION = "1.5.4"
2
+ VERSION = "1.5.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jets
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.4
4
+ version: 1.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen