Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/apparentlymart/terraform-aws-serverless-webapp
Terraform module for deploying "serverless" applications to AWS Lambda and Amazon API Gateway
https://github.com/apparentlymart/terraform-aws-serverless-webapp
Last synced: 11 days ago
JSON representation
Terraform module for deploying "serverless" applications to AWS Lambda and Amazon API Gateway
- Host: GitHub
- URL: https://github.com/apparentlymart/terraform-aws-serverless-webapp
- Owner: apparentlymart
- License: mpl-2.0
- Created: 2018-02-13T02:50:03.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-07-09T15:08:44.000Z (over 3 years ago)
- Last Synced: 2024-12-08T18:03:24.160Z (17 days ago)
- Language: HCL
- Size: 8.79 KB
- Stars: 3
- Watchers: 3
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Terraform AWS Lambda Serverless Application Module
This repository contains an opinionated Terraform module for deploying
"serverless" web applications to AWS Lambda and exposing them publicly using
AWS API Gateway running in its proxy mode.The main "opinion" of this module is that the AWS Lambda versioning and
API Gateway "stage" concepts are not important when you are using Terraform,
since your Terraform configuration ought to be under version control and so you
can easily recover older versions and apply them. This module expects that
you will upload code packages to S3 and treat them as immutable once uploaded,
and thus the S3 object key will change for each new version to be deployed.A less significant "opinion" is that if you use a custom domain name then you
will use ACM for its TLS certificate.## Usage
The following example deploys a NodeJS-based Lambda function and creates a
public-facing API Gateway proxy in front of it.```hcl
provider "aws" {
region = "us-east-1"
}module "app" {
source = "apparentlymart/serverless-webapp/aws"lambda_function_name = "TerraformServerlessExample"
lambda_execution_role = "${aws_iam_role.lambda_exec.arn}"
lambda_runtime = "nodejs4.3"
lambda_handler = "main.handler"api_gateway_name = "TerraformServerlessExample"
artifact_s3_bucket = "terraform-serverless-example"
artifact_s3_object_key = "v1.0.0/example.zip"
}resource "aws_iam_role" "lambda_exec" {
name = "serverless_example_lambda"assume_role_policy = <