@@ -23,7 +23,7 @@ Custom AWS Lambda runtime for executing Bash functions as serverless application
2323
2424``` bash
2525# handler.sh
26- hello () {
26+ main () {
2727 local event=" $1 "
2828 echo ' {"message": "Hello from Bash Lambda!", "input": ' " $event " ' }'
2929}
@@ -142,6 +142,7 @@ aws lambda create-function \
142142 --code ImageUri=123456789012.dkr.ecr.region.amazonaws.com/my-lambda:latest \
143143 --role arn:aws:iam::123456789012:role/lambda-execution-role \
144144 --package-type Image \
145+ --architectures arm64 \
145146 --timeout 30
146147```
147148
@@ -161,17 +162,14 @@ resource "aws_lambda_function" "bash_function" {
161162
162163### Using Lambda Runtime Interface Emulator
163164
164- ``` bash
165- # Download RIE (one time setup)
166- mkdir -p ~ /.aws-lambda-rie
167- curl -Lo ~ /.aws-lambda-rie/aws-lambda-rie \
168- https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie
169- chmod +x ~ /.aws-lambda-rie/aws-lambda-rie
165+ https://github.com/aws/aws-lambda-runtime-interface-emulator/
166+
167+ The emulator is already available on the image, you just need to override the ` entrypoint ` to run test your lambda locally
170168
169+ ```
171170# Run your function locally
172171docker run --rm -p 9000:8080 \
173- -v ~ /.aws-lambda-rie:/aws-lambda \
174- -e HANDLER=" handler.hello" \
172+ --env _HANDLER="handler.hello" \
175173 --entrypoint /aws-lambda/aws-lambda-rie \
176174 my-lambda:latest /var/runtime/bootstrap
177175
@@ -180,15 +178,6 @@ curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" \
180178 -d '{"name": "World"}'
181179```
182180
183- ### Debug Mode
184-
185- ``` bash
186- # Run with debug output
187- docker run --rm -p 9000:8080 \
188- -e HANDLER=" handler.hello" \
189- -e _LAMBDA_RUNTIME_DEBUG=1 \
190- my-lambda:latest
191- ```
192181
193182## Building from Source
194183
@@ -239,8 +228,8 @@ The shell runtime is **highly competitive** with official runtimes while providi
239228
240229** Function not found:**
241230``` bash
242- # Ensure your function is defined and handler matches
243- HANDLER= " handler.my_function " # filename.function_name
231+ # Ensure your function is defined and you override
232+ # the CMD hander.my_function
244233```
245234
246235** Permission errors:**
0 commit comments