https://github.com/patrykorwat/infraconv
Convert infrastructure resources
https://github.com/patrykorwat/infraconv
crossplane opentofu terraform
Last synced: 6 months ago
JSON representation
Convert infrastructure resources
- Host: GitHub
- URL: https://github.com/patrykorwat/infraconv
- Owner: patrykorwat
- License: agpl-3.0
- Created: 2025-01-24T19:26:02.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-02-24T23:22:46.000Z (8 months ago)
- Last Synced: 2025-02-25T00:26:10.443Z (8 months ago)
- Topics: crossplane, opentofu, terraform
- Language: Go
- Homepage:
- Size: 165 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# infraconv
Convert between infrastructure definition frameworks.Tool for now only works for AWS provider.
Supported source formats:
* Terraform/OpenTofuSupported target formats:
* CrossplaneExample input TF file
```terraform
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}required_version = ">= 1.2.0"
}provider "aws" {
region = "us-west-2"
}resource "aws_instance" "test_server" {
ami = "ami-830c94e3"
instance_type = "t2.micro"tags = {
Name = "infraconv-test-ec2-instance"
}
}resource "aws_s3_bucket" "test-bucket" {
bucket = "infraconv-test-bucket"
}
```Sample output of command `infraconv tf convert`:
```yaml
apiVersion: ec2.aws.upbound.io/v1beta2
kind: Instance
spec:
forProvider:
ami: ami-830c94e3
instanceType: t2.micro
region: us-west-2
tags:
Name: infraconv-test-ec2-instance
---
apiVersion: s3.aws.upbound.io/v1beta2
kind: Bucket
metadata:
name: infraconv-test-bucket
spec:
forProvider:
region: us-west-2
```Things to consider when passing TF files:
1. Modules are not supported
2. References aren't supported
3. Boolean fields can only contain boolean values,`true` or `false`, string values like`"true"` aren't supported