Deployment
AWS Deployment
Section titled “AWS Deployment”Prerequisites
Section titled “Prerequisites”- AWS CLI configured with appropriate credentials
- cargo-lambda - Install with:
cargo install cargo-lambda
IAM Role Management
Section titled “IAM Role Management”The deployment process automatically handles IAM role creation. When you deploy, Rusteze will:
- Check if the
lambda-execution-roleexists in your AWS account - Create the role if it doesn’t exist, with the appropriate trust policy for Lambda
- Attach the
AWSLambdaBasicExecutionRolepolicy for basic Lambda execution permissions
No manual IAM setup is required!
Deploying your service
Section titled “Deploying your service”-
Generate the deployment artifacts:
Terminal window cargo rusteze codegen -
Deploy to AWS:
Terminal window cargo rusteze deploy
The deployment will:
- Build all Lambda functions from your routes
- Create/update Lambda functions in AWS
- Set up API Gateway with proper routing
- Configure permissions between API Gateway and Lambda
Configuration
Section titled “Configuration”Update your rusteze.toml file:
service_name = "my-service"
[deployment]provider = "aws"region = "us-east-1" # Change to your preferred regiontype = "lambda"
[lambda]memory_size = 256 # MBExample Output
Section titled “Example Output”After successful deployment, you’ll see:
🚀 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/statusTesting your deployment
Section titled “Testing your deployment”# Test a GET endpointcurl https://your-api-id.execute-api.region.amazonaws.com/prod/hello/world
# Test a POST endpointcurl -X POST https://your-api-id.execute-api.region.amazonaws.com/prod/calculate \ -H "Content-Type: application/json" \ -d '{"a": "5", "b": "3"}'