Back to Blog

Alchemy - Reimagining Infrastructure-as-Code for Modern Development

Eduardo Rabelo
by Eduardo Rabelo
Alchemy - Reimagining Infrastructure-as-Code for Modern Development

In a cloud-native world with a sea of tools and frameworks, where we often combine multiple abstractions layers, a new contestant must offer something genuinely transformative to capture our ever-diminishing attention. It's a tough battlefield out there!

Enter Alchemy, a next-generation Infrastructure-as-Code (IaC) framework developed by Sam Goodwin. Positioned as more than just another Terraform or SST alternative, Alchemy rethinks infrastructure management from the ground up using the modern TypeScript ecosystem to manage complex cloud resources and deployment.

The vision behind Alchemy

At its core, Alchemy is built for developers who live in the TypeScript ecosystem. Alchemy breaks away from the conventional infrastructure-as-code ecosystem by being built entirely in ESM-native TypeScript code.

No wrappers, no multiple languages, no custom DSL, YAML or JSON, no external runtimes!

Tools like Terraform, Pulumi, SST, and AWS CDK form a layered, often convoluted stack. SST builds on Pulumi, which in turn wraps Terraform, each tooling adding its own complexity.

SST, Pulumi, Terraform layers of infrastructure-as-code stack complexity

Meanwhile, AWS CDK compiles into CloudFormation JSON and supports AWS resources only. Extending it often means deploying a custom resource backed by a Lambda function to execute your custom logic. A notoriously clusterfuck cumbersome process.

AWS CDK, AWS CloudFormation layers of infrastructure-as-code stack complexity

Alchemy simplifies all of this. It eliminates the indirection and tightly-coupled toolchains, reducing infrastructure to clean, composable, async TypeScript functions. It’s lightweight, unopinionated, and designed to work with you, not against you!

Alchemy Zero Dependencies Philosophy

AWS Lambda Infographic

AWS Lambda on One Page (No Fluff)

Skip the 300-page docs. Our Lambda cheat sheet covers everything from cold starts to concurrency limits - the stuff we actually use daily.

HD quality, print-friendly. Stick it next to your desk.

Privacy Policy
By entering your email, you are opting in for our twice-a-month AWS newsletter. Once in a while, we'll promote our paid products. We'll never send you spam or sell your data.

Sam Goodwin’s decade-long experience building cloud systems inspired him to create a toolkit and a philosophy shift: infrastructure should feel like code, not configuration.

“I want infrastructure to feel like importing a module and writing a function” - Sam Goodwin

And he’s built exactly that!

To provision infrastructure, Alchemy talks directly to cloud services APIs (e.g., AWS, CloudFlare, GitHub) via HTTPS requests.

  • Alchemy includes lightweight clients for each provider grouping their resources.

  • It doesn’t abstract or obscure these interactions it exposes them as composable resources.

  • You still configure credentials (e.g., AWS credentials in your environment), but Alchemy doesn’t need a wrapper language or an execution engine in Go or Rust.

Alchemy enable developers to interact with cloud infrastructure like they do with any other library: without heavyweight runtimes, opaque wrappers, or complex toolchains.

It embraces cloud services APIs without adding its own middle layer.

Alchemy Zero Dependencies stack

By pairing strongly-typed TypeScript syntax with cloud service API specifications, Alchemy is able to auto-generate resources and documentation using LLMs!

Alchemy auto-generating resources and documentation with LLMs

The service you use isn't available as an Alchemy Resource? No problem!

All you need is an async TypeScript function! 🚀

Alchemy provides a easy-to-learn resource api, along with a clear scope and lifecycle model, allowing you to build your own custom group of resources:

  • Resource - The fundamental building blocks used to define infrastructure (eg. await Aws.Bucket)

  • Phase - Alchemy applications run in multiple phases, such as read, up, and destroy.

  • Scope - Hierarchical containers that organize resources and other scopes, similar to a file system.

  • State - A transparent, pluggable state management system that tracks resource lifecycles and supports idempotent operations. It’s simple by design, with backend options ranging from local files to cloud storage.

And by default, Alchemy provides a mechanism to encrypt sensitive values (eg. your state file or environment variable).

Sounds too good to be true? Let’s try it out!

Using Alchemy with AWS

Alchemy's getting started highlights each step we need to take!

Create a new TypeScript project

We'll be using Bun for direct TypeScript support:

mkdir alchemy-acme
cd alchemy-acme
bun init -y

Your folder structure should look like:

.
├── README.md
├── bun.lock
├── index.ts
├── node_modules
├── package.json
└── tsconfig.json

Alchemy's convention is to use a alchemy.run.ts file as entry point, let's rename index.ts:

mv index.ts alchemy.run.ts

Your folder structure should look like:

.
├── README.md
├── alchemy.run.ts
├── bun.lock
├── node_modules
├── package.json
└── tsconfig.json

Add Alchemy Resources

Add the Alchemy package:

bun add alchemy

Update alchemy.run.ts contents to:

import alchemy from "alchemy";
import { Bucket } from "alchemy/aws";

const stage = process.env.STAGE || "dev";

const app = await alchemy("app", {
  stage,
  phase: process.argv.includes("--destroy") ? "destroy" : "up",
});

const bucket = await Bucket("bucket", {
  bucketName: `alchemy-acme-bucket-${stage}`,
});

await app.finalize();

We are using Alchemy's AWS client to create a single bucket in our account.

The STAGE, APP and PHASE were defined, ensuring we can have access to Alchemy's lifecycle.

Deploy to AWS

Ensure you have a valid AWS Session and credentials in your terminal and execute:

bun alchemy.run.ts

Create:  "app/dev/bucket"
Created: "app/dev/bucket"

Checking the AWS Console, we can see our bucket deployed:

Alchemy deployed bucket in AWS Console

🥳 Congratulations, you used Alchemy successfully for the first time!

Remove AWS resources

Let's clean up our mess with the destroy command:

bun alchemy.run.ts --destroy

Delete:  "app/dev/bucket"
Deleted: "app/dev/bucket"

It was easy, wasn't it?

Conclusion

Alchemy is still early in its journey, but it already offers a refreshing perspective on how we manage cloud infrastructure. By using a common language developers are already familiar (eg. TypeScript) it lowers the learning curve, encourages contributions, and brings clarity to a space often known by complexity.

As with any new framework, there will be challenges and growing pains. But with an open-source foundation, thoughtful design, and a focus on developer experience, Alchemy has the potential to become a meaningful tool in the infrastructure toolkit. It’s opinionated yet flexible, powerful yet approachable, and ready to push the boundaries of what cloud infrastructure automation can look like.

With just a handful of primitives like Resource, Scope, Secret, State, and Bindings, you can create complex, production-grade infrastructure while writing normal TypeScript.

Alchemy lowers the barrier by:

  • Using a language developers already know (TypeScript)

  • Reducing the need to learn unfamiliar DSLs or CLIs

  • Supporting in-editor help through strong typing

  • Making testing and documentation easy and native

This fundamentally democratizes infrastructure work, turning ops from a specialist-only concern into a collaborative part of the development process.

If you’re tired of wrestling with Terraform plans or duplicating boilerplate CDK stacks, it might be time to let Alchemy work its magic! 🧙‍♂️

Alchemy Meme

AWS Lambda Infographic

AWS Lambda on One Page (No Fluff)

Skip the 300-page docs. Our Lambda cheat sheet covers everything from cold starts to concurrency limits - the stuff we actually use daily.

HD quality, print-friendly. Stick it next to your desk.

Privacy Policy
By entering your email, you are opting in for our twice-a-month AWS newsletter. Once in a while, we'll promote our paid products. We'll never send you spam or sell your data.