https://github.com/dmk/react-tf
React renderer to render terraform files
https://github.com/dmk/react-tf
Last synced: 4 months ago
JSON representation
React renderer to render terraform files
- Host: GitHub
- URL: https://github.com/dmk/react-tf
- Owner: dmk
- License: other
- Created: 2025-01-17T15:43:27.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-19T22:57:40.000Z (over 1 year ago)
- Last Synced: 2025-09-24T14:33:56.085Z (8 months ago)
- Language: TypeScript
- Size: 38.1 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-react-renderer - react-tf - Render Terraform HCL code using JSX Templates. (File)
README
# React Terraform Renderer
Write your Terraform configurations using React components, leveraging React's composition patterns and TypeScript's type safety.
## Installation
```bash
npm install -g @dkkoval/react-tf
```
## CLI Usage
The `react-tf` CLI tool can process individual files or directories:
```bash
# Process current directory
react-tf
# Process specific directory
react-tf ./terraform
# Process specific file
react-tf ./terraform/main.tsx
# Process multiple files
react-tf ./terraform/main.tsx ./terraform/network.tsx
# Mix files and directories
react-tf ./terraform/main.tsx ./other-terraform
```
## Library Usage
Here's a basic example:
```tsx
import { Terraform, Provider, Resource } from '@dkkoval/react-tf';
const Infrastructure = () => (
);
export default Infrastructure;
```
## Examples
The [examples](examples) directory contains several examples showcasing different features:
- [Basic Usage](examples/basic.tsx) - Simple provider and resource setup
- [Advanced Configuration](examples/advanced.tsx) - Variables, multiple instances, and outputs
- [React Patterns](examples/patterns.tsx) - Reusable components and composition patterns
## Development
```bash
# Install dependencies
bun install
# Run tests
bun test
# Build package
bun run build
```
## License
Apache License 2.0 - see [LICENSE](LICENSE) for details.
## Author
Dmytro Koval: [GitHub](https://github.com/dmk), [LinkedIn](https://www.linkedin.com/in/dmk/)