https://github.com/express42/terraform-aws-lambda-python
https://github.com/express42/terraform-aws-lambda-python
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/express42/terraform-aws-lambda-python
- Owner: express42
- License: mit
- Created: 2017-12-28T09:22:57.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-08-10T09:25:30.000Z (almost 7 years ago)
- Last Synced: 2025-01-18T14:46:37.301Z (over 1 year ago)
- Language: HCL
- Size: 25.4 KB
- Stars: 25
- Watchers: 19
- Forks: 21
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Terraform module for AWS Lambda Python function deployment
Terraform module which prepares and deploys python lambda function and prepares all necessities for it in AWS infrastructure.
## Features
* Downloads python dependencies from requirements.txt to `lambda/lib` directory
* Archives lambda function with all dependencies into `lambda.zip`
* Creates IAM policy, lambda function, API Gateway and CloudWatch log group
* Creates IAM policy with additional rules
* Deploy lambda function
* Possible to use with python virtualenv
## Usage
### Preparation
* Put logic into `lambda_handler` in `lambda/main.py`
* Put your Lambda function requirements into `requirements.txt`
### Configuration example
```hcl
module "lambda_python" {
source = "express42/lambda-python/aws"
aws_profile = "default"
aws_region = "eu-west-1"
pip_path = "/usr/bin/pip"
lambda_name = "lambda_example"
lambda_api_name = "lambda_example_api"
lambda_iam_name = "lambda_example_iam"
api_stage_name = "dev"
api_resource_path = "example"
api_http_method = "POST"
iam_additional_policy = <