Expand description
§Teleform
Teleform is a library designed to facilitate Infrastructure as Code (IaC) using Rust. It provides a flexible and powerful alternative to tools like Terraform and Pulumi by allowing developers to describe infrastructure changes as a Directed Acyclic Graph (DAG). Unlike other solutions, Teleform does not provide wrappers over platform-specific resources, eschewing them in favor of direct interaction with platform APIs. This removes a layer of indirection and keeps your infrastructure domain specific.
§Key Features
- Resource Management: Define and manage resources directly through Rust code, allowing for seamless integration with other libraries.
- Dependency Tracking: Automatically track dependencies between resources to ensure correct order of operations.
- Migration Support: Easily migrate resources and manage changes over time.
§Usage
Teleform is typically used by developers to write custom IaC command line programs executed at a developer workstation.
These programs are meant to be fluid, changing as often as the infrastructure, with changes committed and tracked with version control.
§Concepts
Teleform operates on the concept of local and remote states of resources:
- Local State: This is the desired state of the resource as defined in your Rust code. It represents the initial configuration of a platform resource.
- Remote State: This is the state of the resource as it exists on the platform (e.g., AWS, Digital Ocean). It reflects the configuration and status of the resource.
Teleform uses these states to determine the necessary actions to apply. This involves creating, updating, or deleting resources as needed.
An example usage can be found in crates/teleform/src/test.rs
,
demonstrating how to define and manage resources using the library’s
primitives.
§Target Audience
This library is intended for developers, particularly those in solo or small team environments, who are looking for a more general and flexible solution to IaC. It is also suitable for those seeking to migrate away from Terraform.
§Error Handling
Teleform exposes a comprehensive error enum Error
, which encompasses all
possible errors that may occur during operations. Functions that can result
in errors return a Result
type with this Error
, ensuring robust error
handling throughout the library.
Modules§
Structs§
Enums§
- Action
Create
,Load
andUpdate
result in a resource being added to the graph.- Error
- Top-level error enum that encompasses all errors.
Traits§
- HasDependencies
- Tracks dependencies between resources.
- Resource
- IaC resources.
- User
Error - Marker trait for userland errors.