aws_utils_lambda
AWS Lambda utilities for Rust, providing a simplified interface for AWS Lambda operations.
Features
- Easy client creation with automatic credential handling
- Lambda function invocation with comprehensive parameter support
- Error handling with custom error types
- Re-exports
aws_sdk_lambdafor direct access to AWS SDK types
Installation
Add this to your Cargo.toml:
[]
= "0.1.0"
Usage
Creating a Lambda Client
use aws_utils_lambda;
async
The client creation functions automatically handle AWS credentials:
- Uses existing AWS environment variables if set
- Sets dummy values for local development if not configured
- Defaults to
us-west-2region ifAWS_REGIONis not set
Timeout Configuration
use ;
use Duration;
async
Invoking Lambda Functions
use ;
use Blob;
async
Error Handling
The crate provides custom error types that wrap AWS SDK errors:
use Error;
match invoke.await
API Reference
Client Creation Functions
make_client_with_timeout_default(endpoint_url: Option<String>)- Creates a Lambda client with default timeout settingsmake_client_with_timeout(endpoint_url, connect_timeout, operation_timeout, operation_attempt_timeout, read_timeout)- Creates a Lambda client with custom timeout settingsmake_client(endpoint_url: Option<String>, timeout_config: Option<TimeoutConfig>)- Creates a Lambda client with optional custom endpoint and timeout configuration
Lambda Functions
lambda::invoke(client, function_name, client_context, invocation_type, log_type, payload, qualifier)- Invokes a Lambda function with comprehensive parameter support
Re-exports
The crate re-exports aws_sdk_lambda for direct access to AWS SDK types:
use ;
License
This project is licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.