Skip to content

hckhanh/pulumi-any-terraform

Repository files navigation

Pulumi Any Terraform

Use any Terraform provider with Pulumi
Full type safety β€’ Multi-language support β€’ Seamless integration

A collection of dynamically bridged Pulumi providers that enable you to use any Terraform provider within the Pulumi ecosystem. This repository provides seamless integration between Terraform providers and Pulumi, allowing you to leverage the extensive Terraform provider ecosystem while enjoying Pulumi's modern infrastructure-as-code experience.

autofix enabled License: MIT npm

πŸš€ Features

  • πŸ”„ Full Terraform Compatibility - Use any Terraform provider with Pulumi
  • πŸ“˜ Complete Type Safety - Full TypeScript definitions with IntelliSense
  • 🌍 Multi-Language Support - TypeScript, JavaScript, Python, Go, and C# (planned)
  • ⚑ Dynamic Updates - Auto-sync with upstream Terraform providers
  • 🎯 Native Pulumi Experience - Full integration with Pulumi's ecosystem
  • πŸ”’ Secure by Design - Pulumi secrets management and state encryption
  • πŸ“¦ Production Ready - Battle-tested bridge technology

πŸ“¦ Available Providers

Provider Package Description
Better Uptime pulumi-better-uptime Monitoring and incident management
Bunnynet pulumi-bunnynet CDN and edge computing
Infisical pulumi-infisical Secrets management
Logtail pulumi-logtail Log management and analytics
Namecheap pulumi-namecheap Domain and DNS management
Portainer pulumi-portainer Container management
TeamCity pulumi-teamcity CI/CD platform
Time pulumi-time Time-based resources

⚑ Quick Start

Installation

Each package can be installed independently:

npm install pulumi-namecheap
# or
yarn add pulumi-namecheap
# or
pnpm add pulumi-namecheap

Basic Usage

import * as pulumi from '@pulumi/pulumi'
import * as namecheap from 'pulumi-namecheap'

// Configure provider (or use environment variables)
const config = new pulumi.Config('namecheap')

// Create a DNS record
const record = new namecheap.Record('www-record', {
  domain: 'example.com',
  hostname: 'www',
  type: 'A',
  address: '192.168.1.1',
  ttl: 300,
})

// Export the record ID
export const recordId = record.id

Deploy

pulumi preview  # Preview changes
pulumi up       # Deploy infrastructure

πŸ“š Documentation

Comprehensive documentation is available covering:

πŸ—οΈ Architecture

This project uses Pulumi's Terraform Bridge to automatically convert Terraform providers into native Pulumi providers:

Terraform Provider β†’ Bridge β†’ Pulumi Package β†’ Your Infrastructure Code

Key components:

  • Nx Monorepo - Efficient build orchestration
  • TypeScript - Full type safety and IntelliSense
  • Automated CI/CD - GitHub Actions with automated testing and publishing
  • Changesets - Semantic versioning and release management

πŸ› οΈ Development

Prerequisites

  • Node.js 22.18.0 or later
  • pnpm 10.14.0 or later
  • Pulumi CLI 3.190.0 or later

Setup

  1. Clone and install:

    git clone https://github.com/hckhanh/pulumi-any-terraform.git
    cd pulumi-any-terraform
    pnpm install
  2. Verify setup:

    pnpm run syncpack:check
    pnpm nx run-many -t check

Common Tasks

# Install dependencies
pnpm install

# Check code quality
pnpm nx run-many -t check

# Fix formatting and linting
pnpm nx run-many -t fix

# Build all packages
pnpm nx run-many -t build

# Sync dependency versions
pnpm run syncpack:fix

# Format all code
pnpm run prettier:write

Adding a New Provider

  1. Create package directory structure
  2. Configure package.json with proper metadata
  3. Set up parameterization for Terraform provider
  4. Write comprehensive documentation
  5. Submit pull request

See the Contributing Guide for detailed instructions.

Project Structure

pulumi-any-terraform/
β”œβ”€β”€ packages/              # Provider packages
β”‚   β”œβ”€β”€ better-uptime/    # Individual providers
β”‚   β”œβ”€β”€ bunnynet/
β”‚   β”œβ”€β”€ infisical/
β”‚   β”œβ”€β”€ logtail/
β”‚   β”œβ”€β”€ namecheap/
β”‚   β”œβ”€β”€ portainer/
β”‚   β”œβ”€β”€ teamcity/
β”‚   └── time/
β”œβ”€β”€ tools/                 # Build system plugins
β”‚   β”œβ”€β”€ build.ts
β”‚   β”œβ”€β”€ linter.ts
β”‚   └── prettier.ts
β”œβ”€β”€ docs/                  # Documentation site (Next.js)
β”œβ”€β”€ .github/              # CI/CD workflows
β”œβ”€β”€ nx.json               # Nx configuration
└── pnpm-workspace.yaml   # Workspace config

CI/CD Pipeline

Automated workflows handle:

  • Testing: Linting, type checking, and builds
  • Auto-fixing: Prettier and Biome fixes
  • Dependency Updates: Automated PRs for updates
  • Publishing: Automatic releases to NPM
  • Security: Socket Security and vulnerability scanning

🀝 Contributing

We welcome contributions! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

Please read our Contributing Guide for details on:

  • Code standards
  • Development workflow
  • Adding new providers
  • Testing requirements
  • Release process

πŸ› Troubleshooting

Common issues and solutions:

  • Installation fails: Clear cache and retry
  • Type errors: Update @pulumi/pulumi version
  • Authentication errors: Check credentials and environment variables
  • Build failures: Clear Nx cache with pnpm nx reset

See our Troubleshooting Guide for more help.

πŸ”— External Connections

This project integrates with:

πŸ“Š Project Stats

  • 8 Providers available
  • MIT Licensed - Free and open source
  • Active Development - Regular updates
  • Production Ready - Used in real projects

🌟 Examples

Multi-Provider Infrastructure

import * as pulumi from '@pulumi/pulumi'
import * as namecheap from 'pulumi-namecheap'
import * as betteruptime from 'pulumi-better-uptime'

// DNS Configuration
const apiRecord = new namecheap.Record('api', {
  domain: 'example.com',
  hostname: 'api',
  type: 'A',
  address: '192.168.1.100',
})

// Monitoring
const monitor = new betteruptime.Monitor('api-monitor', {
  url: pulumi.interpolate`https://${apiRecord.hostname}.${apiRecord.domain}`,
  monitorType: 'status',
  checkFrequency: 60,
})

export const apiUrl = pulumi.interpolate`https://${apiRecord.hostname}.${apiRecord.domain}`
export const monitorId = monitor.id

πŸ™ Acknowledgments

This project is built on top of:

  • Pulumi - Infrastructure as Code platform
  • Terraform - Provider ecosystem
  • Nx - Monorepo build system
  • All the amazing Terraform provider maintainers

πŸ“œ License

MIT License - see LICENSE file for details.

πŸ‘¨β€πŸ’» Author

KhΓ‘nh HoΓ ng

πŸ”— Links


⭐ If you find this project useful, please consider giving it a star on GitHub!

About

Porting version of some Terraform providers to Pulumi

Topics

Resources

Stars

Watchers

Forks

Contributors 7