https://github.com/alexandermendes/tf-aws-lambda-api
A Terraform module to create an AWS Lambda resource from file and invoke via API Gateway.
https://github.com/alexandermendes/tf-aws-lambda-api
aws terraform
Last synced: about 2 months ago
JSON representation
A Terraform module to create an AWS Lambda resource from file and invoke via API Gateway.
- Host: GitHub
- URL: https://github.com/alexandermendes/tf-aws-lambda-api
- Owner: alexandermendes
- Created: 2019-10-12T17:30:21.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-16T21:52:36.000Z (over 6 years ago)
- Last Synced: 2025-01-28T01:32:50.706Z (over 1 year ago)
- Topics: aws, terraform
- Language: HCL
- Homepage:
- Size: 30.3 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Terraform AWS Lambda API Gateway Module
A Terraform module to create an AWS Lambda resource from file and invoke via API Gateway.
## Usage
For a function `my-function.py` placed in the `functions` directory in the root
of the repository the following snippet will generate a POST endpoint to invoke
that function.
```terraform
module "lambda-api" {
source = "git::https://github.com/alexandermendes/tf-aws-lambda-api.git?ref=tags/v1.0.0"
http_method = "POST"
function_name = "my-function"
dir = "functions"
ext = "py"
runtime = "python3.7"
handler = "lambda_handler"
}
```
**Note that the source reference above is just an example, in most cases you
should update it to the [latest tag](https://github.com/alexandermendes/tf-aws-lambda-api/tags).**
For additional variables and outputs see [variables.tf](./variables.tf) and
[outputs.tf](./outputs.tf), respectively.