Skip to content

dmk/react-tf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Terraform Renderer

Write your Terraform configurations using React components, leveraging React's composition patterns and TypeScript's type safety.

Installation

npm install -g @dkkoval/react-tf

CLI Usage

The react-tf CLI tool can process individual files or directories:

# 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:

import { Terraform, Provider, Resource } from '@dkkoval/react-tf';

const Infrastructure = () => (
  <Terraform>
    <Provider 
      name="aws" 
      configuration={{
        region: "us-west-2"
      }}
    />
    <Resource
      type="aws_instance"
      name="example"
      attributes={{
        ami: "ami-0c55b159cbfafe1f0",
        instance_type: "t2.micro"
      }}
    />
  </Terraform>
);

export default Infrastructure;

Examples

The examples directory contains several examples showcasing different features:

Development

# Install dependencies
bun install

# Run tests
bun test

# Build package
bun run build

License

Apache License 2.0 - see LICENSE for details.

Author

Dmytro Koval: GitHub, LinkedIn

About

React renderer to render terraform files

Resources

License

Stars

Watchers

Forks

Packages

No packages published