terraform-aws-lambda  by terraform-aws-modules

Terraform module for AWS Lambda resource management

Created 5 years ago
1,007 stars

Top 37.1% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

This Terraform module simplifies the creation and management of AWS Lambda functions and layers, offering extensive customization for build processes, deployments, and resource configurations. It's designed for Terraform users who need robust control over their serverless infrastructure, from dependency management to advanced deployment strategies like canary releases.

How It Works

The module leverages a Python script (package.py) to intelligently build deployment packages. It supports local builds or Dockerized builds (with SSH agent forwarding for private dependencies) for any Lambda runtime and architecture. The packaging process is optimized for speed and idempotency, generating identical zip archives for identical content to prevent unnecessary resource updates. It can also deploy pre-built packages from local paths, S3, or ECR container images.

Quick Start & Requirements

  • Install: Use the module in your Terraform configuration:
    module "lambda_function" {
      source = "terraform-aws-modules/lambda/aws"
      # ... other configurations
    }
    
  • Prerequisites: Terraform >= 1.0, AWS provider >= 5.79. Python 3.6+ is required for local builds. Docker is needed for Dockerized builds.
  • Setup: Basic setup involves defining the module in your .tf files. Complex builds or Docker configurations may require additional setup time.
  • Docs: serverless.tf framework

Highlighted Details

  • Supports building dependencies locally or within Docker, including private repositories via SSH agent forwarding.
  • Offers granular control over deployment packages, including multiple source paths, custom patterns, and build commands.
  • Facilitates advanced deployment strategies like rolling updates and canary releases using Lambda aliases and AWS CodeDeploy.
  • Integrates with AWS SAM CLI for local testing and cloud-based testing with SAM Accelerate.
  • Manages Lambda@Edge functions, VPC integration, EFS mounts, and event source mappings.

Maintenance & Community

Managed by Anton Babenko. Commercial support is available through Betajob.

Licensing & Compatibility

Apache 2.0 Licensed. Compatible with commercial use.

Limitations & Caveats

When using source_path with multiple concurrent module calls for the same source, zip archives can be corrupted; use hash_extra or external packaging. Terraform CI/CD workers may require a custom Docker image with Python pre-installed.

Health Check
Last Commit

3 weeks ago

Responsiveness

1 day

Pull Requests (30d)
2
Issues (30d)
8
Star History
5 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems") and Philipp Schmid Philipp Schmid(DevRel at Google DeepMind).

production-stack by vllm-project

1.0%
2k
Reference stack for production vLLM deployment on Kubernetes
Created 8 months ago
Updated 2 days ago
Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Will Brown Will Brown(Research Lead at Prime Intellect), and
7 more.

cohere-toolkit by cohere-ai

0.7%
3k
RAG toolkit for LLM application development and deployment
Created 1 year ago
Updated 5 days ago
Feedback? Help us improve.