Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Run Bash scripts in AWS Lambda via Layers
| Date | Stars |
|---|---|
| 2026-07-24 | 424 |
| 2026-07-25 | 424 |
| 2026-07-28 | 424 |
| 2026-07-30 | 424 |
| 2026-08-08 | 423 |
| 2026-09-20 | 423 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# Bash in AWS Lambda
## NO LONGER SUPPORTED
This repository and layer is no longer receiving updates or support. I've been too busy to keep up with changes in the Lambda environment and this has fallen behind. Use at your own risk.
---
Run Bash in [AWS Lambda](https://aws.amazon.com/lambda/) via [Layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html). This Layer is 100% Bash and handles all communication with the Lambda Runtime 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.
See the [How To](#how-to) section to understand how to use these layers. Also see the [example-basic.sh](examples/example-basic.sh) file for an example of how to write a Bash script compatible with this Layer.
### ARN
```
arn:aws:lambda:<region>:744348701589:layer:bash:8
```
## How To
### Getting Started
#### AWS Lambda Console
1. Login to your AWS Account and go to the Lambda Console.
2. Create a new function and give it a name and an IAM Role.
3. For the "Runtime" selection, select `Use custom runtime in function code or layer`.
4. In the "Designer" section of your function dashboard, select the `Layers` box.
5. Scroll down to the "Referenced Layers" section and click `Add a layer`.
6. Select the `Provide a layer version ARN` option, then copy/paste the [Layer ARN](#ARN) for your region.
7. Click the `Add` button.
8. Click `Save` in the upper right.
9. Upload your code and start using Bash in AWS Lambda!
#### AWS CLI
1. Create a function that uses the `provided` runtime and the [Layer ARN](#ARN) for your region.
```
$ aws lambda create-function \
--function-name bashFunction \
--role bashFunctionRole \
--handler index.handler \
--runtime provided \
--layers arn:aws:lambda:<region>:744348701589:layer:bash:8 \
--zip-file fileb://function.zip
```
2. Start using Bash in AWS Lambda!
### Updating Versions
#### AWS Lambda Console
1. In the "Designer" section of your function dashboard, select the `Layers` box.
2. Scroll down to the "Referenced Layers" section and click `Add a layer`.
3. Select the `Provide a layer version ARN` option, then copy/paste the [Layer ARN](#ARN) for your region.
4. Click the `Add` button.
5. Still under the "Referenced Layers" section, select the previous version and click `Remove`.
6. Click `Save` in the upper right.
#### AWS CLI
1. Update your function's configration and add the [Layer ARN](#ARN) for your region.
```
$ aws lambda update-function-configuration \
--function-name bashFunction \
--layers arn:aws:lambda:<region>:744348701589:layer:bash:8
```
### Writing Scripts
Like any other Lambda function code, your main script's name must match the first part of your handler. Inside your main script, you must define a function that matches the second part of the handler. You must have `set -e` be the first line inside your function. Putting `#!/bin/bash` at the top of your file is not necessary. So if your Lambda handler is `index.handler`, your file and contents should look like:
```
$ cat index.sh
handler () {
set -e
...
}
```
The `event` data is sent to your function as the first parameter. To access it, you should use `$1`. So if you need the `event` data, you should set it to a variable. For example, `EVENT_DATA=$1`.
```
handler () {
set -e
EVENT_DATA=$1
}
```
All the pre-installed tools are already in your `$PATH` so you can use them as expected. Any command output is automatically sent to CloudWatch, just like normal Lambda functions.
```
handler () {
set -e
EVENT_DATA=$1
aws s3 ls $(echo $EVENT_DATA | jq ."bucket")
}
```
If you need to send a response back, you should send the response to `stderr`. (see the [Caveats](#CAVEATS) section for an explanation) To send output to `stderr` you should use `>&2`. This will be picked up and returned from the Lambda function.
```
handler () {
set -e
EVENT_DATA=$1
Excerpt of 8,528 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:3e31e74dc61c38bf, topic:serverless