hcl

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: MIT Imports: 14 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 {
	// TODO: Change it to "map[string]map[string]schema.ResourceData"
	Config 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) *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 map[string]string)

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