You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+52-17Lines changed: 52 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,18 +3,30 @@
3
3
4
4
* See the full blog post describing how to install and use this small chaos library [here](https://medium.com/@adhorn/injecting-chaos-to-aws-lambda-functions-using-lambda-layers-2963f996e0ba).
5
5
6
-
### Changes by Gunnar Grosch
7
-
Some changes made to be able to control injection per function instead of for all functions.
8
-
9
-
* Each function with the layer attached must have an environment variable named FAILURE_INJECTION_PARAM and containing the name of a parameter in Parameter Store.
10
-
11
-
* The layer can be easily installed using the serverless.yml template file using Serverless Framework: sls deploy
12
-
13
-
### Building the zip package on a MAC (easy on Linux)
14
-
* Regardless if you are using Linux, Mac or Windows, the simplest way to create your ZIP package for Lambda Layer is to use Docker. If you don't use Docker but instead build your package directly in your local environment, you might see an ```invalid ELF header``` error while testing your Lambda function. That's because AWS Lambda needs Linux compatible versions of libraries to execute properly.
15
-
16
-
* That's where Docker comes in handy. With Docker you can very easily run a Linux container locally on your Mac, Windows and Linux computer, install the Python libraries within the container so they're automatically in the right Linux format, and ZIP up the files ready to upload to AWS. You'll need Docker installed first. (https://www.docker.com/products/docker).
17
-
6
+
### Features
7
+
* Support for Latency injection using ```delay```
8
+
* Support for Exception injection using ```exception_msg```
9
+
* Support for HTTP Error status code injection using ```error_code```
10
+
* Using for SSM Parameter Store to control the experiment using ```isEnable```
11
+
* Per Lambda function injection control using Environment variable (```FAILURE_INJECTION_PARAM```) (thanks to Gunnar Grosh)
12
+
* Support for Serverless Framework using ```sls deploy``` (thanks to Gunnar Grosh)
2. Spin-up a docker-lambda container, and install all the Python requirements in a directory call .vendor
38
+
39
+
40
+
2. Build the package manually (skip to step 4 if you want to use the serverless framework)
41
+
42
+
Regardless if you are using Linux, Mac or Windows, the simplest way to create your ZIP package for Lambda Layer is to use Docker. If you don't use Docker but instead build your package directly in your local environment, you might see an ```invalid ELF header``` error while testing your Lambda function. That's because AWS Lambda needs Linux compatible versions of libraries to execute properly. That's where Docker comes in handy. With Docker you can very easily run a Linux container locally on your Mac, Windows and Linux computer, install the Python libraries within the container so they're automatically in the right Linux format, and ZIP up the files ready to upload to AWS. You'll need Docker installed first. (https://www.docker.com/products/docker).
43
+
44
+
- Spin-up a docker-lambda container, and install all the Python requirements in a directory call .vendor
27
45
* run the following command:
28
46
29
47
```
@@ -33,17 +51,34 @@ Some changes made to be able to control injection per function instead of for al
33
51
* The -v flag makes the local directory available inside the container in the directory called working. You should now be inside the container with a shell prompt.
34
52
35
53
36
-
3. Package your code.
54
+
3. Package your code
37
55
* run the following commands:
38
56
```
39
57
$ zip -r chaos_lib.zip ./python
40
58
```
41
59
42
-
Voila! Your package file chaos_lib.zip is ready to be used in Lambda Layer.
60
+
Voila! Your package file chaos_lib.zip is ready to be used in Lambda Layer.
0 commit comments