Deployment command
Deploy Command Implementation Summary
Section titled “Deploy Command Implementation Summary”Overview
Section titled “Overview”The cargo rusteze deploy command provides automated deployment of Rusteze applications to AWS using Lambda and API Gateway.
What it does
Section titled “What it does”1. Configuration Reading
Section titled “1. Configuration Reading”- Reads
rusteze.tomlfor deployment configuration (provider, region, memory settings) - Reads
.rusteze/manifest.jsonfor generated function metadata
2. Function Building
Section titled “2. Function Building”- Builds all Lambda functions in the
.rustezedirectory usingcargo lambda build --release --output-format zip - Uses cargo-lambda for proper cross-compilation and Lambda packaging
- Creates optimized zip deployment packages for each function
3. AWS Deployment
Section titled “3. AWS Deployment”- Route Functions: Deploys HTTP endpoint handlers as Lambda functions
- Auth Functions: Deploys authentication handlers
- Subscriber Functions: Deploys pub/sub topic subscribers
- API Gateway: Creates HTTP API with proper routing and integrations
4. Manifest Updates
Section titled “4. Manifest Updates”- Updates
manifest.jsonwith deployed ARNs for tracking - Stores API Gateway ID for future deployments
# Generate deployment artifactscargo rusteze codegen
# Deploy to AWScargo rusteze deployPrerequisites
Section titled “Prerequisites”- AWS CLI configured with appropriate credentials
- cargo-lambda installed:
cargo install cargo-lambda - Generated
.rustezedirectory from codegen
Note: IAM roles are automatically created during deployment if they don’t exist.
Configuration
Section titled “Configuration”In rusteze.toml:
service_name = "my-service"
[deployment]provider = "aws"region = "us-east-1"type = "lambda"
[lambda]memory_size = 256Output
Section titled “Output”The command provides:
- Deployment progress with function-by-function status
- API Gateway URL for testing
- List of available endpoints
- Updated manifest with ARNs
Example Output
Section titled “Example Output”🚀 Deployment complete!API Gateway ID: abc123def456API URL: https://abc123def456.execute-api.us-east-1.amazonaws.com/prod
Available endpoints: GET /hello/{word} -> https://abc123def456.execute-api.us-east-1.amazonaws.com/prod/hello/{word} POST /calculate -> https://abc123def456.execute-api.us-east-1.amazonaws.com/prod/calculate GET /status -> https://abc123def456.execute-api.us-east-1.amazonaws.com/prod/statusArchitecture
Section titled “Architecture”- Each route becomes a separate Lambda function
- API Gateway HTTP API handles routing and integration
- Lambda functions use custom runtime (
provided.al2) - Functions are named with pattern:
{service_name}-{binary_name} - ARNs are tracked in manifest for updates and management
Error Handling
Section titled “Error Handling”- Handles existing functions by updating code
- Provides clear error messages for missing prerequisites
- Validates AWS credentials and permissions
- Graceful handling of API Gateway conflicts