Convert HCL to INI

Turn HCL files into INI. Top-level objects become [sections] and plain top-level values come first, and an object inside a section becomes its own section named with a dot, such as [server.tls].

Converted in an isolated sandbox on our serversDeleted after 24 hours

Drop HCL files on the dialor turn it to pick what to do

HCL settings as an INI file.Objects become sections, and nested objects get dotted section names.

  1. What you get

    One INI file. Plain top-level values come first. Each top-level object becomes a [section], and an object inside a section becomes its own section named with a dot, such as [server.tls].

    Blocks nest by type and label, so they end up as sections in the same way.

  2. How lists and expressions come out

    A list becomes a repeated key, one line per item. An empty list disappears, so it leaves no key in the INI file. Objects or lists inside a list are written as JSON text.

    Expressions become ${...} text.

  3. Top-level lists

    A top-level list becomes one section per entry, numbered from 0 under items, such as [items.0]. An entry that is not an object goes under the key value.

HCL and INI.What each format is.

The formats

From · HCL

HCL

HashiCorp Configuration Language, what Terraform and Packer files are written in.

Extensions
.hcl .tf .tfvars
MIME type
application/x-hcl
Kind
Text and data
To · INI

INI

Sections of key and value pairs, the settings format of Windows and many tools.

Extensions
.ini .cfg
MIME type
text/x-ini
Kind
Text and data

In your code.The same HCL to INI conversion through the API, for your app or your agent.

terminal
$ cv convert report.hcl report.ini
$ cv convert report.hcl report.ini

Questions.What people ask about HCL to INI.

01OF 04

Each one becomes its own section with a dotted name. An object inside a section named server becomes [server.tls] if it is called tls.

It becomes a repeated key. An empty list is left out, and objects or lists inside a list are written as JSON text.

It is written as ${...} text.

Yes. INI to HCL converts in the other direction.

More conversions.Other ways in and out of HCL and INI.