# π¦ fl8 β Lightweight Cloud-Agnostic IaC Library
[](LICENSE)
fl8 is a Rust library for **infrastructure as code (IaC)**, designed to be **cloud-agnostic**, enabling deployment across AWS, other cloud providers, and SaaS platforms. Its goal is to provide a **fast, type-safe, and modular framework** for defining infrastructure resources and deployments.
---
## π§© Features
- Define cloud infrastructure in Rust with **strong typing**
- Focused on **performance**, leveraging Rustβs speed and memory safety
- Support for multiple clouds and SaaS platforms
- Modular resource definitions with optional **stacks** and **constructs**
- Easy-to-extend library with **examples and tests** included
---
## π¦ Installation
Add `fl8` as a dependency in your `Cargo.toml`:
```toml
[dependencies]
fl8 = "0.1.0"
```
---
## π Project Structure
```
fl8/
ββ .devcontainer/ # VS Code DevContainer configuration
ββ .vscode/ # VS Code settings & tasks
ββ examples/ # Examples
ββ src/ # Rust source code
ββ tests/ # Tests
ββ Cargo.toml # Rust project manifest
ββ rustfmt.toml # Rust formatter configuration
ββ README.md
```
---
## π» CLI Commands
`fl8` provides a lightweight command-line interface for managing your infrastructure. The two primary commands are `plan` and `launch`.
---
### πΊοΈ `fl8 plan`
The `plan` command previews the changes that will be made by your infrastructure definitions without applying them. It acts as a dry run.
```bash
fl8 plan
```
* Analyzes your resource definitions.
* Shows a summary of resources that will be created, updated, or deleted.
* Useful to review the impact of changes before deployment.
Example output:
```
Plan: 3 to add, 1 to modify, 0 to destroy
- AWS::S3::Bucket "my-bucket" -> create
- AWS::Lambda::Function "handler" -> create
- Postgres::Database "app-db" -> modify
```
### π `fl8 launch`
The `launch` command executes the deployment based on your current stack or construct definitions.
```bash
fl8 launch
```
* Applies the planned changes to your cloud provider.
* Creates, updates, or deletes resources as necessary.
* Automatically tracks the deployment state for future runs.
Example output:
```bash
fl8 plan # Preview the changes first
fl8 launch # Apply the changes
```
Notes:
* Itβs recommended to run fl8 plan before fl8 launch.
* The command respects resource dependencies and deployment order.
#### π© Optional Flags
You can extend the CLI with optional flags for more control:
* `--stack <name>`: Deploy a specific stack.
* `--construct <name>`: Deploy a specific construct.
* `--dry-run`: Show the plan without making changes (similar to plan).
Example:
```bash
fl8 launch --stack my-stack --dry-run
```
---
## π’ Getting Started
### Requirements
* **VS Code** with Remote Containers extension
* **Podman** or **Docker**
* **Rust toolchain** (automatically installed in Dev Container)
* **AWS CLI**
---
### βοΈ Development Setup
1. Clone the repository:
```bash
git clone https://github.com/kodlot/fl8.git
cd fl8
```
2. Open VS Code and **Reopen in Dev Container**.
3. Dev Container will automatically install:
* Rust (stable, 2024 edition)
* `rustfmt` and `clippy`
* Rust Analyzer extension
* AWS CLI
4. Start coding! Rust files will **auto-format on save**, and Clippy can be run via VS Code Tasks.
---
### β
Running Tests
```bash
cargo test
```
This command will:
* Compile your crate and its dependencies.
* Run all unit tests defined in `#[cfg(test)]` modules.
* Show detailed output for passed, failed, and ignored tests.
---
### π‘ Running Examples
```bash
cargo run --example example_stack
```
---
### β¨ Formatting and Linting
* Auto-format on save is enabled (`rustfmt`).
* To manually format:
```bash
cargo fmt
```
* To run lint checks:
```bash
cargo clippy --all-targets --all-features
```
---
### π Contributing
We welcome contributions! Please open issues or submit pull requests for bug fixes, new features, or improvements. By contributing, you agree that your contributions will be licensed under the Apache 2.0 license.
1. Fork the repository
2. Create a feature branch: `git checkout -b feature-name`
3. Commit your changes: `git commit -m "Description"`
4. Push to branch: `git push origin feature-name`
5. Open a Pull Request
---
### βοΈ License
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.
---
### π€οΈ Roadmap
* Implement first stable IaC deployment engine
* Add project/stack/construct resource organization
* Improve CLI and automation tooling