Pulumi Adds Full Bun Runtime Support
Summary
Pulumi has announced full support for Bun as a runtime, moving beyond its previous role as a package manager option. With Pulumi 3.227.0, developers can specify `runtime: bun` in their `Pulumi.yaml` to execute infrastructure programs without requiring a Node.js installation. Bun, developed by Jarred Sumner and acquired by Anthropic, is a JavaScript runtime built on JavaScriptCore that integrates a package manager, bundler, and test runner into a single binary. It offers significantly faster startup times (5–15ms vs 60–120ms) and 6–35x faster package installs compared to Node.js. Key benefits for Pulumi users include native TypeScript execution, faster dependency installation for CI/CD, and 100% Node.js compatibility. Existing projects can migrate by updating `Pulumi.yaml`, `tsconfig.json`, and `package.json` for ESM support.
Key takeaway
For MLOps Engineers and Software Engineers managing infrastructure as code, adopting Bun as your Pulumi runtime can significantly accelerate CI/CD pipelines and simplify TypeScript workflows. If your projects do not rely on Pulumi's callback functions or dynamic providers, migrating to Bun 1.3+ and Pulumi 3.227.0+ will provide substantial performance gains in program execution and dependency management, streamlining your deployment processes.
Key insights
Bun is now a fully supported Pulumi runtime, offering faster performance and native TypeScript execution.
Principles
- Consolidate tools for efficiency
- Prioritize native language support
Method
Migrate existing Pulumi projects to Bun by updating `runtime` in `Pulumi.yaml`, configuring `tsconfig.json` with `module: "Preserve"` and `moduleResolution: "bundler"`, and adding `"type": "module"` to `package.json`.
In practice
- Use `pulumi new bun` for new projects
- Enable top-level await in ESM programs
- Set `packagemanager: bun` for Node.js projects
Topics
- Pulumi
- Bun Runtime
- Infrastructure as Code
- TypeScript Execution
- Node.js Compatibility
Code references
Best for: Software Engineer, DevOps Engineer, MLOps Engineer
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by InfoQ.