Skip to content

Commit 829f538

Browse files
author
Graham Krizek
committed
Update README
1 parent c0cec59 commit 829f538

File tree

1 file changed

+39
-2
lines changed

1 file changed

+39
-2
lines changed

README.md

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,39 @@
1-
# lambda-bash
2-
AWS Lambda Layer for Bash runtime
1+
# Bash in AWS Lambda
2+
3+
Run Bash in AWS Lambda via Layers. This Layer is 100% Bash and handles all communication with the Lambda API. This allows you to run full Bash scripts and commands inside of AWS Lambda. This Layer also includes common CLI tools used in Bash scripts.
4+
5+
## How To
6+
7+
#### Caveats
8+
9+
Bash behaves in ways unlike other programming languages. As such, there are some requirements on the user's end that must be done.
10+
11+
- `set -e` must be set _inside_ your function
12+
13+
By default, a bash script won't exit when it encounters an error. In order for the layer to correctly catch the error and report it (as well as stop the script from executing), we must set the function to exit on error.
14+
15+
- You must send your return value to `stderr`
16+
17+
Inside a Bash function, anything that is sent to `stdout` is part of the return value for that function. In order to properly capture the user's return value and still send `stdout` to CloudWatch, this Layer uses `stderr` as the return value. To send something to `stderr` simply append ` >&2` to the end of the command. See the example.sh script for help.
18+
19+
### ARNs
20+
21+
**us-east-1**
22+
23+
`arn`
24+
25+
26+
### Included Executables
27+
28+
- `$ aws`
29+
- `$ curl`
30+
- `$ git`
31+
- `$ gunzip`
32+
- `$ gzip`
33+
- `$ jq`
34+
- `$ tar`
35+
- `$ unzip`
36+
- `$ wget`
37+
- `$ zip`
38+
39+
_If you would like to see more, please create an issue._

0 commit comments

Comments
 (0)