Minimal shell Lambda function using only the custom runtime layer.
- Shell script as Lambda handler
- Custom
provided.al2023runtime with the shell bootstrap layer - Using built-in
curl(no additional layers needed)
handler.sh (curl) → runtime layer → Lambda (provided.al2023)
terraform init
terraform applyInvoke:
aws lambda invoke --function-name shell-handler /dev/stdoutrun () {
curl -Ss https://wttr.in/?format=3
}The runtime layer provides the bootstrap that sources handler.sh and calls the function specified in the handler setting (e.g. handler.run → sources handler.sh, calls run).