- Notifications
You must be signed in to change notification settings - Fork0
ql4b/lambda-shell-layers
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Lambda layers for shell runtime tools and utilities
Pre-built Lambda layers containing common CLI tools and utilities for use withlambda-shell-runtime. Each layer provides statically-linked binaries optimized for AWS Lambda.
- jq - Command-line JSON processor
- qrencode - QR code generation from command line
- htmlq - HTML parsing and extraction tool
- yq - YAML/XML/JSON processing tool
- http-cli - Minimal HTTP client for shell scripts
- pcre2grep - Perl-compatible regex pattern matching
- uuid - UUID generation utility
# serverless.ymlprovider:layers: -arn:aws:lambda:us-east-1:ACCOUNT:layer:ql4b-shell-qrencode:1 -arn:aws:lambda:us-east-1:ACCOUNT:layer:ql4b-shell-htmlq:1functions:handler:environment:PATH:"/opt/bin:${env:PATH}"
# Build specific layercd qrencode&& ./build.sh# Build all layers./scripts/build-all.sh# Deploy layer to AWS./scripts/deploy-layer.sh qrencode
All layers follow the same structure:
/opt/├── bin/ # Executable binaries└── lib/ # Shared libraries (if needed)Binaries are placed in/opt/bin and automatically available when you add/opt/bin to yourPATH.
# In your Lambda functionapi_handler() {local text="$1" qrencode -o /tmp/qr.png"$text"echo"QR code generated at /tmp/qr.png"}
# Extract data from HTMLapi_handler() {local html="$1"echo"$html"| htmlq'.title' --text}
# Make HTTP requestsapi_handler() {local response=$(http-cli --header"Content-Type: application/json" https://api.example.com)echo"$response"| jq'.data'}
# Find patterns in textapi_handler() {local text="$1"echo"$text"| pcre2grep -o"[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}" --ignore-case}
# Generate a UUIDapi_handler() {local uuid=$(uuidgen)echo"Generated UUID:$uuid"}
Each layer includes:
- Dockerfile - Multi-stage build for static binaries
- build.sh - Build and package script
- README.md - Usage documentation
- Docker
- AWS CLI (for deployment)
- zip utility
# Reference pre-built layerdata"aws_lambda_layer_version""qrencode" {layer_name="ql4b-shell-qrencode"}# Use in functionresource"aws_lambda_function""handler" {layers=[data.aws_lambda_layer_version.qrencode.arn]environment {variables={ PATH="/opt/bin:${env:PATH}" } }}
To add a new layer:
- Create directory with layer name
- Add Dockerfile with multi-stage build
- Create build.sh script
- Add README.md with usage examples
- Test with lambda-shell-runtime
- Runtime:
provided.al2023 - Architecture:
arm64,x86_64 - Compatible with:lambda-shell-runtime
Part of thecloudless ecosystem.
About
Lambda layers with CLI tools and utilities for shell runtime functions. Pre-built binaries for qrencode, htmlq, imagemagick, and more.
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published