localstack-extensions
LocalStack Extensions
Manage LocalStack Extensions to add custom functionality, integrate third-party tools, and extend LocalStack capabilities.
Capabilities
- Install and manage LocalStack Extensions
- Discover available extensions
- Configure extension settings
- Develop custom extensions
Extension Management
List Installed Extensions
localstack extensions list
Install Extensions
# Install from PyPI
localstack extensions install localstack-extension-name
# Install specific version
localstack extensions install localstack-extension-name==1.0.0
# Install from Git repository
localstack extensions install "git+https://github.com/org/extension-repo.git"
Uninstall Extensions
localstack extensions uninstall localstack-extension-name
Enable/Disable Extensions
# Extensions are enabled by default after installation
# Disable via environment variable
EXTENSION_NAME_ENABLED=0 localstack start -d
Available Extensions
Community Extensions
Check the LocalStack Extensions Registry for community-contributed extensions.
Using Extensions
MailHog Extension
# Install
localstack extensions install localstack-extension-mailhog
# Start LocalStack
localstack start -d
# Access MailHog UI
open http://localhost:8025
# SES emails will be captured by MailHog
awslocal ses send-email \
--from sender@example.com \
--to recipient@example.com \
--subject "Test" \
--text "Hello"
Developing Custom Extensions
Extension Structure
my-extension/
├── setup.py
├── my_extension/
│ ├── __init__.py
│ └── extension.py
Basic Extension
# extension.py
from localstack.extensions.api import Extension, http
class MyExtension(Extension):
name = "my-extension"
def on_extension_load(self):
print("Extension loaded!")
def on_platform_start(self):
print("LocalStack is starting!")
@http.route("/my-endpoint")
def my_endpoint(self, request):
return {"message": "Hello from extension!"}
Install Local Extension
# Install in development mode
localstack extensions install -e ./my-extension
Configuration
Extensions can be configured via environment variables:
# General pattern
EXTENSION_<NAME>_<SETTING>=value localstack start -d
# Example
EXTENSION_MAILHOG_PORT=8025 localstack start -d
Troubleshooting
- Extension not loading: Check
localstack logsfor errors - Conflicts: Disable conflicting extensions
- Version issues: Ensure extension is compatible with your LocalStack version
More from localstack/skills
localstack
Manage LocalStack container lifecycle. Use when users need to start, stop, restart, or check status of LocalStack, configure LocalStack environment variables, or troubleshoot LocalStack container issues.
77localstack-deploy
Deploy infrastructure to LocalStack using IaC tools. Use when users want to deploy Terraform, CDK, CloudFormation, or Pulumi to LocalStack, or need help configuring tflocal, cdklocal, pulumilocal, or awslocal wrappers.
41localstack-logs
Analyze LocalStack logs and debug issues. Use when users need to view LocalStack logs, debug AWS API errors, troubleshoot Lambda functions, identify error patterns, or enable debug mode.
39localstack-state
Manage LocalStack state and snapshots. Use when users want to save, load, export, or import LocalStack state, work with Cloud Pods, create local snapshots, or enable persistence across restarts.
38localstack-iam
Analyze and enforce IAM policies in LocalStack. Use when users want to enable IAM enforcement, detect permission violations, auto-generate least-privilege policies, or test IAM policies locally before deploying to AWS.
34