Ruby Lambda Template
by delian7
This repository provides a template for building AWS Lambda functions using Ruby. It allows you to customize and handle HTTP requests or other tasks in a serverless environment.
Last updated: N/A
Ruby Lambda Template
This repository serves as a template for building AWS Lambda functions using Ruby. Customize it as needed to handle HTTP requests or other tasks in a serverless environment.
Prerequisites
- Ruby
- Bundler
- AWS CLI
Setup
-
Clone the repository:
git clone https://github.com/delian7/ruby_lambda_template cd ruby_lambda_template
-
Install the dependencies:
bundle install
-
Configure environment variables (if needed):
If you require environment configuration, copy the
.env.sample
file to.env
and update it accordingly:cp .env.sample .env
Running Tests
To run the tests using RSpec:
bundle exec rspec
Deploying to AWS Lambda
-
Configure AWS CLI:
aws configure
-
Package the application:
zip -r lambda_function.zip .
-
Update the Lambda function code:
aws lambda update-function-code --function-name your_lambda_function_name \ --zip-file fileb://lambda_function.zip
Alternatively, you can combine packaging and updating:
zip -r lambda_function.zip . && aws lambda update-function-code --function-name your_lambda_function_name \
--zip-file fileb://lambda_function.zip
Usage
This repository provides a starting point for AWS Lambda functions written in Ruby. Modify the Lambda function code and tests as needed for your specific use case.