This repository serves as a starter template or skeleton for developing and maintaining AWS Lambda functions using Python runtime. It aims to streamline the development process by providing a reusable structure, so you can avoid the repetitive task of copying and pasting old code. Instead, simply clone this repository to get started quickly.
This template was developed during my work as a Data Engineer at PMI to streamline AWS Lambda development. It is tailored for my current needs and may also serve as a helpful resource for colleagues who wish to adopt it.
- Pre-configured Makefile: Simplifies building, testing, and running your Lambda code locally.
- Dockerfile: Provides a containerized environment to run your code, ensuring compatibility and consistency.
- Environment File Support: Allows direct injection of AWS Access Key and Secret Key via an environment file, removing the need to manually set environment variables.
- AWS Lambda Python Runtime: Tailored for Python-based AWS Lambda development.
Ensure these are installed:
- Docker
- Make
Clone this repository to your local machine:
git clone https://github.com/calvinkmts/aws-python-lambda-starter.git
cd aws-python-lambda-starter
The repository includes a Makefile to simplify common tasks. Here are the available commands:
make build
make run
The provided Dockerfile sets up a containerized environment for your python lambda function. It includes:
- Python runtime (currently using 3.9)
- Dependencies installation (using requirements.txt)
You can use an .env file to inject your AWS credentials directly into the environment.