Works with HashiCorp HCL. Allows to append the input file with blocks and attributes from the template file

About hclmergetool

Works with HashiCorp HCL. Allows to append the input file with blocks and attributes from the template file

Installation

Binary Release

Latest releases are available here on Github -> Releases . hclmergetool is a single binary, installation is as simple as placing the binary in your PATH.

Install with Go

go install github.com/max-fedorov/hclmergetool@latest

Usage

hclmergetool -i [FILE] -t [FILE]

Arguments:

-i  --input     path to HCL input file. Default: 
-t  --template  path to HCL template file. Default: 
-o  --output    path to HCL output file. If not specified, print to stdout.
              
-v  --version   show version
-h  --help      print help information

Example

hclmergetool -i current.tf -t current_templ.tf -o current_override.tf
  • current.tf
resource "aws_subnet" "public-1" {
    var_a = asd
    var_b = old_value
    old_block {
        var_block_a = qwe
    }
}

resource "aws_subnet" "public-2" {
    var_a = asd
    var_b = old_value
    old_block {
        var_block_a = qwe
    }
    new_block {

    }
}

resource "aws_subnet" "public-3" {
    var_a = asd
    var_b = old_value
    var_c = qwe
}

resource "aws_subnet_local" "public-4" {
}
  • current_templ.tf
resource "aws_subnet" {
    var_a = asd
    var_b = new_value
    var_c = qwe_new

    old_block {
        var_block_a = qwe
        var_block_b = qwe_new
    }

    new_block {
        var_block_c = qwe
    }
}
  • current_override.tf
resource "aws_subnet" "public-1" {
    var_a = asd
    var_b = new_value
    old_block {
        var_block_a = qwe
        var_block_b = qwe_new
    }

    new_block {
        var_block_c = qwe
    }
    var_c = qwe_new
}

resource "aws_subnet" "public-2" {
    var_a = asd
    var_b = new_value
    old_block {
        var_block_a = qwe
        var_block_b = qwe_new
    }
    new_block {

        var_block_c = qwe
    }
    var_c = qwe_new
}

resource "aws_subnet" "public-3" {
    var_a = asd
    var_b = new_value
    var_c = qwe_new

    old_block {
        var_block_a = qwe
        var_block_b = qwe_new
    }

    new_block {
        var_block_c = qwe
    }
}

resource "aws_subnet_local" "public-4" {
}
Similar Resources

Go-turing-i2c-cmdline - Controlling the i2c management bus of the turing pi with i2c works fine

go-turing-i2c-cmdline What is it? Controlling the i2c management bus of the turi

Jan 24, 2022

Ghdl - A much more convenient way to download GitHub release binaries on the command line, works on Win & Unix-like systems

ghdl Memorize ghdl as github download ghdl is a fast and simple program (and als

Oct 12, 2022

Input Geojson and utilize Dijkstra's formula to provide the best route between two sets of coordinates

Golang GeoJson Dijkstra Golang GeoJson Dijkstra utilizes GeoJson Feature Collections to find the best the shortest route between two points. Installat

Dec 27, 2022

A command-line tool that triggers command when the input (doesn't) comes from STDIN in an interval.

conk A command-line tool that triggers command when the input (doesn't) comes from STDIN in an interval. Usage $ conk -h A command-line tool that trig

Apr 29, 2022

Knit is an inline code generation tool that combines the power of Go's text/template package with automatic spec file loading.

Knit Knit is an inline code generation tool that combines the power of Go's text/template package with automatic spec file loading. Example openapi: "

Sep 15, 2022

As the name says. Forges badge responses for the Defcon 29 badge and allows folks to jump straight to having completed the signal.

Defcon 29 Badge Code Generator Exactly as the title says. Will generate 7 signal keys to get you to signal then will generate 20 keys to distribute th

Aug 25, 2021

Allows you to swap usernames at https://solo.to, I swapped @/city and @/lose with this program :)

Allows you to swap usernames at https://solo.to, I swapped @/city and @/lose with this program :)

Solo.To-Username-Swapper added the exe version for people who do not have Go installed, how ever I reccomend installing it at https://golang.org Getti

Sep 29, 2021

This application is a tool that allows you to prepare mail designs specific to your group and make Christmas raffles.

What is this? This application is a tool that allows you to prepare mail designs specific to your group and make Christmas raffles. How is it working?

Dec 15, 2022

Package fsm allows you to add finite-state machines to your Go code.

fsm Package fsm allows you to add finite-state machines to your Go code. States and Events are defined as int consts: const ( StateFoo fsm.State =

Dec 9, 2022
Documenting your Threat Models with HCL
Documenting your Threat Models with HCL

hcltm Threat Modeling with HCL Overview There are many different ways in which a threat model can be documented. From a simple text file, to more in-d

Nov 23, 2022
basic append ops lib by golang

basic append ops lib by golang

Oct 28, 2021
Package buildinfo provides basic building blocks and instructions to easily add build and release information to your app.
Package buildinfo provides basic building blocks and instructions to easily add build and release information to your app.

Package buildinfo provides basic building blocks and instructions to easily add build and release information to your app. This is done by replacing variables in main during build with ldflags.

Nov 14, 2021
Tanzu Framework provides a set of building blocks to build atop of the Tanzu platform and leverages Carvel packaging

Tanzu Framework provides a set of building blocks to build atop of the Tanzu platform and leverages Carvel packaging and plugins to provide users with a much stronger, more integrated experience than the loose coupling and stand-alone commands of the previous generation of tools.

Dec 16, 2022
Geth client which picks the most profitable blocks to mine using a greedy algorithm

Greeden-Geth Greeden-Geth is a protocol-agnostic client which uses a greedy algorithm to pick the most profitable blocks to submit to the network out

Nov 16, 2022
DSV Parallel Processor takes input files and query specification via a spec file

DSV Parallel Processor Spec file DSV Parallel Processor takes input files and query specification via a spec file (conventionally named "spec.toml").

Oct 9, 2021
Nomad Pack is a templating and packaging tool used with HashiCorp Nomad.

Nomad Pack is a templating and packaging tool used with HashiCorp Nomad.

Jan 4, 2023
Yet another Go REPL that works nicely. Featured with line editing, code completion, and more.
  Yet another Go REPL that works nicely. Featured with line editing, code completion, and more.

gore Yet another Go REPL that works nicely. Featured with line editing, code completion, and more. (Screencast taken with cho45/KeyCast) Usage gore Af

Jan 7, 2023
Packer Plugin Vagrant - The Vagrant multi-component plugin can be used with HashiCorp Packer to create custom images

Packer Plugin Vagrant - The Vagrant multi-component plugin can be used with HashiCorp Packer to create custom images

Jul 13, 2022
The primary place where Optimism works on stuff related to Optimistic Ethereum
The primary place where Optimism works on stuff related to Optimistic Ethereum

The Optimism Monorepo TL;DR This is the primary place where Optimism works on stuff related to Optimistic Ethereum. Documentation Extensive documentat

Dec 16, 2022