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 +4 -4
- data/.github/PULL_REQUEST_TEMPLATE.md +3 -3
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/lib/jets/resource/lambda/function/environment.rb +37 -0
- data/lib/jets/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfde14902f5b9c192e521369854a5f2a2a22107bd76db0ea3f477ac31c4c7079
|
4
|
+
data.tar.gz: 14db8a09cd677052bd696a7e87c5ba22eec569a97d19c904e52e9119506ff59b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
@@ -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