Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Lambda layers with CLI tools and utilities for shell runtime functions. Pre-built binaries for qrencode, htmlq, imagemagick, and more.

NotificationsYou must be signed in to change notification settings

ql4b/lambda-shell-layers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.

Available Layers

  • 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

Quick Start

Using Pre-built Layers

# 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}"

Building Your Own

# Build specific layercd qrencode&& ./build.sh# Build all layers./scripts/build-all.sh# Deploy layer to AWS./scripts/deploy-layer.sh qrencode

Layer Structure

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.

Usage Examples

QR Code Generation

# In your Lambda functionapi_handler() {local text="$1"    qrencode -o /tmp/qr.png"$text"echo"QR code generated at /tmp/qr.png"}

HTML Parsing

# Extract data from HTMLapi_handler() {local html="$1"echo"$html"| htmlq'.title' --text}

HTTP Requests

# Make HTTP requestsapi_handler() {local response=$(http-cli --header"Content-Type: application/json" https://api.example.com)echo"$response"| jq'.data'}

Pattern Matching

# Find patterns in textapi_handler() {local text="$1"echo"$text"| pcre2grep -o"[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}" --ignore-case}

Generate UUIDs

# Generate a UUIDapi_handler() {local uuid=$(uuidgen)echo"Generated UUID:$uuid"}

Building Layers

Each layer includes:

  • Dockerfile - Multi-stage build for static binaries
  • build.sh - Build and package script
  • README.md - Usage documentation

Build Requirements

  • Docker
  • AWS CLI (for deployment)
  • zip utility

Integration with Terraform

# 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}"    }  }}

Contributing

To add a new layer:

  1. Create directory with layer name
  2. Add Dockerfile with multi-stage build
  3. Create build.sh script
  4. Add README.md with usage examples
  5. Test with lambda-shell-runtime

Layer Compatibility


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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp