Alchemy
Alchemy is a TypeScript-based Infrastructure-as-Code framework that uses Effect to enable type-safe, hot-reloading cloud development with built-in observability and PR previews.
Alchemy is an Infrastructure-as-Code (IaC) framework built entirely in TypeScript and powered by the Effect library. Designed to take applications from zero to production, it allows developers to define, provision, and manage cloud infrastructure using standard TypeScript programs. By treating infrastructure as part of the application code rather than external configuration, Alchemy provides a unified development experience for cloud-native applications, specifically targeting environments like Cloudflare and AWS.
Alchemy simplifies cloud development by providing a single, type-safe program to manage infrastructure lifecycle, IAM policies, and application code. It enables developers to plan and preview changes, deploy infrastructure stacks, run tests against live cloud resources, and manage observability such as logs and metrics, all within a hot-reloading loop. It abstracts away complex boilerplate associated with cloud providers by providing high-level bindings that automatically generate necessary security policies and environment configurations.
Some of the key features are:
- TypeScript-First IaC: Define infrastructure directly within TypeScript, leveraging type checking for IAM policies, environment variables, and resource configurations.
- Fast Feedback Loops: Utilize local hot-reloading for both backend logic and infrastructure changes, enabling rapid iteration against live cloud environments.
- Integrated Testing: Run tests against real cloud resources with isolated stacks, ensuring environment consistency and eliminating the need for complex mock systems.
- Ephemeral PR Previews: Automate the creation of per-pull-request environments, allowing teams to verify changes in a production-like setting before merging.
- Unified Observability: Instrument dashboards and alarms alongside the resources they monitor, with automatic OpenTelemetry integration.
- Automatic IAM Generation: Eliminate manual policy management; Alchemy infers and generates least-privilege security policies based on resource bindings.
Alchemy operates by treating infrastructure components as resources within an Effect-based generator function. Developers define a Stack that composes providers, resources, and application workers. When using the CLI, the plan command calculates the diff between the local code and the state store, deploy applies changes to the provider, and destroy handles resource cleanup. The framework maintains a persistent state store (e.g., in a Cloudflare Worker) to track resources between deployments, ensuring reliable state management and convergence to the target configuration.
Some common use cases include:
- Full-Stack Application Deployment: Managing frontend, backend, and infrastructure in a single repository and codebase.
- Automated CI/CD Workflows: Setting up preview environments for every pull request to ensure safe team collaboration and verification.
- Cloud-Native Prototyping: Rapidly standing up infrastructure like R2 buckets, KV stores, or Lambda functions for early-stage development.
- Secure Cloud Operations: Enforcing security best practices via automatic IAM generation and managed credentials for CI pipelines.
Comments
0Markdown is supported.