mapstructure-to-hcl2

command
v1.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2019 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Overview

mapstructure-to-hcl2 fills the gaps between hcl2 and mapstructure for Packer

By generating a struct that the HCL2 ecosystem understands making use of mapstructure tags.

Packer heavily uses the mapstructure decoding library to load/parse user config files. Packer now needs to move to HCL2.

Here are a few differences/gaps betweens hcl2 and mapstructure:

  • in HCL2 all basic struct fields (string/int/struct) that are not pointers are required ( must be set ). In mapstructure everything is optional.

  • mapstructure allows to 'squash' fields (ex: Field CommonStructType `mapstructure:",squash"`) this allows to decorate structs and reuse configuration code. HCL2 parsing libs don't have anything similar.

mapstructure-to-hcl2 will parse Packer's config files and generate the HCL2 compliant code that will allow to not change any of the current builders in order to softly move to HCL2.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL