Deploy SignalWire AI Agents to serverless platforms: AWS Lambda, Google Cloud Functions, and Azure Functions.
Each directory contains a complete, deployable Hello World agent with:
- SWML output for SignalWire phone integration
- SWAIG functions (say_hello, get_platform_info, echo)
- Native CLI deployment scripts
| Feature | AWS Lambda | Google Cloud | Azure Functions |
|---|---|---|---|
| CLI | aws |
gcloud |
az |
| Runtime | Python 3.11 | Python 3.11 | Python 3.11 |
| Entry Point | lambda_handler |
main |
main |
| Max Timeout | 15 min | 60 min (Gen 2) | 10 min (Consumption) |
| Cold Starts | ~1-3s | ~1-2s | ~2-5s |
| Min Memory | 128 MB | 128 MB | Flex |
| Free Tier | 1M requests/mo | 2M invocations/mo | 1M executions/mo |
# Install AWS CLI
# macOS
brew install awscli
# Linux
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip && sudo ./aws/install
# Windows
msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi
# Configure credentials
aws configure
# Enter: AWS Access Key ID, Secret Access Key, Default region, Output format# Install gcloud CLI
# macOS
brew install --cask google-cloud-sdk
# Linux/Windows - Download from:
# https://cloud.google.com/sdk/docs/install
# Authenticate
gcloud auth login
# Set project
gcloud config set project YOUR_PROJECT_ID# Install Azure CLI
# macOS
brew install azure-cli
# Linux
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
# Windows
winget install -e --id Microsoft.AzureCLI
# Authenticate
az logincd aws
./deploy.shcd gcloud
./deploy.shcd azure
./deploy.shcloud-functions/
├── README.md # This file
├── aws/
│ ├── handler.py # Lambda handler
│ ├── requirements.txt
│ ├── deploy.sh # AWS CLI deployment
│ └── README.md
├── gcloud/
│ ├── main.py # Cloud Functions entry point
│ ├── requirements.txt
│ ├── deploy.sh # gcloud CLI deployment
│ └── README.md
└── azure/
├── function_app/
│ ├── __init__.py # Azure Functions handler
│ └── function.json
├── host.json
├── requirements.txt
├── deploy.sh # Azure CLI deployment
└── README.md
All three agents implement identical functionality:
| Function | Description | Parameters |
|---|---|---|
say_hello |
Personalized greeting | name (string, required) |
get_platform_info |
Platform runtime information | none |
echo |
Echo back a message | message (string, required) |
- Language: English (en-US)
- Voice: rime.spore
All platforms support these optional environment variables:
| Variable | Description | Default |
|---|---|---|
SWML_BASIC_AUTH_USER |
Basic auth username | Auto-generated |
SWML_BASIC_AUTH_PASSWORD |
Basic auth password | Auto-generated |
Note: If not set, the SDK automatically generates secure credentials. The deploy scripts display the credentials after deployment.
The SignalWire Agents SDK automatically enables HTTP Basic Authentication for security. You can:
- Let the SDK generate credentials - Secure random credentials are created automatically
- Set your own credentials - Via environment variables before deployment:
SWML_BASIC_AUTH_USER=myuser SWML_BASIC_AUTH_PASSWORD=mypass ./deploy.sh
# Replace with your endpoint and credentials
curl -u username:password https://your-endpoint/curl -u username:password -X POST https://your-endpoint/swaig \
-H 'Content-Type: application/json' \
-d '{"function": "say_hello", "argument": {"parsed": [{"name": "Alice"}]}}'# AWS Lambda
cd aws
swaig-test handler.py --simulate-serverless lambda --dump-swml
# Google Cloud Functions
cd gcloud
swaig-test main.py --simulate-serverless cloud_function --dump-swml
# Azure Functions
cd azure/function_app
swaig-test __init__.py --simulate-serverless azure_function --dump-swmlAfter deployment, configure your SignalWire phone number:
- Log into your SignalWire Space
- Navigate to Phone Numbers
- Select your phone number
- Set Handle Calls Using to SWML Script
- Enter the endpoint URL with credentials:
https://user:pass@your-endpoint/
┌──────────────┐ ┌─────────────────┐ ┌──────────────────┐
│ SignalWire │──────│ API Gateway/ │──────│ Cloud Function │
│ Platform │ │ HTTP Trigger │ │ (Your Agent) │
└──────────────┘ └─────────────────┘ └──────────────────┘
│ │ │
│ POST / │ │
│─────────────────────>│───────────────────────>│
│ │ Returns SWML │
│<─────────────────────│<───────────────────────│
│ │ │
│ POST /swaig │ │
│─────────────────────>│───────────────────────>│
│ │ Execute SWAIG func │
│<─────────────────────│<───────────────────────│
│ │ │
- Initialize agent outside the handler function
- Keep dependencies minimal
- Use provisioned concurrency (AWS) or min instances (GCP/Azure)
- Use environment variables for secrets
- Enable basic auth for production (enabled by default)
- Use HTTPS endpoints only
- Enable logging on each platform
- Monitor invocation counts and errors
- Set up alerts for failures
aws lambda delete-function --function-name signalwire-hello-worldgcloud functions delete signalwire-hello-world --region=us-central1 --gen2 --quietaz group delete --name signalwire-hello-world-rg --yes- Python 3.11+
- Docker (for building deployment packages)
- signalwire-agents >= 1.0.10
- Platform CLI tools (see CLI Setup above)