hcl

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package hcl has all abstracted logic related to HCL

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(hcl []byte) []byte

Format formats the hcl to have a better formatter that the default one returned from HCL printer.Fprint

Types

type Writer

type Writer struct {
	// The keys are Config[<category>]["resources"][<resource_type>]
	Config map[string]map[string]interface{}
	// contains filtered or unexported fields
}

Writer is a Writer implementation that writes to a static map to then transform it to HCL

func NewWriter

func NewWriter(w io.Writer, pv provider.Provider, opts *writer.Options) *Writer

NewWriter rerturns an Writer initialization

func (*Writer) Has

func (w *Writer) Has(key string) (bool, error)

Has checks if the given key is already present or not

func (*Writer) Interpolate added in v0.4.0

func (w *Writer) Interpolate(i *interpolator.Interpolator)

Interpolate replaces the hardcoded resources link with TF interpolation.

func (*Writer) Sync

func (w *Writer) Sync() error

Sync writes the content of the Config to the internal w with the correct format

func (*Writer) Write

func (w *Writer) Write(key string, value interface{}) error

Write expects a key similar to "aws_instance.your_name" repeated keys will report an error

Jump to

Keyboard shortcuts

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