This repository contains a template project for building a serverless API using Axum, AWS Lambda, AWS CDK, and API Gateway with OpenAPI integration. The template provides a starting point for building scalable, efficient, and easily deployable APIs on the AWS cloud platform.
- Axum: Axum is a fast and efficient web framework for Rust, designed for building asynchronous APIs.
- AWS Lambda: AWS Lambda allows you to run code without provisioning or managing servers, ensuring automatic scaling and high availability.
- AWS CDK: AWS Cloud Development Kit simplifies the process of defining infrastructure as code using familiar programming languages.
- API Gateway: AWS API Gateway enables you to create, publish, maintain, monitor, and secure APIs at any scale.
- OpenAPI Integration: With OpenAPI specification, enabling automatic generation of documentation and client SDKs.
- Rust
- AWS CLI
- AWS CDK
- Cargo lambda
- Clone the project and change your directory into it. Run the following command.
cargo lambda build --release
- Change into cdk directory and run the following
cd cdk
npm install
npm run cdk deploy
This will deploy the app with all its infrastructure to aws and give you URL.
The api docs with rapidoc will be available at {url}/rapidoc/docs
- For local Development
export APP_APPLICATION__STAGE_NAME=""
cargo lambda watch
By default, the web server will run on http://localhost:9000
. You can test the server by sending a GET request to http://localhost:9000/api/health-check
using your preferred HTTP client.
You can go to http://localhost:9000/rapidoc/docs
for OpenAPI docs.