tfmodule

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

type Module struct {
	Name      string      `hcl:"name,label"`
	Variables []*Variable `hcl:"variable,block"`
	Outputs   []*Output   `hcl:"output,block"`
	Resources []*Resource `hcl:"resource,block"`
	Source    string      `hcl:"source,attr"`
}

Module is a struct to express terraform module

func (*Module) String

func (m *Module) String() string

type Output

type Output struct {
	Name        string          `hcl:"name,label"`
	Value       hclwrite.Tokens `hcl:"value,attr"`
	Description string          `hcl:"description,attr"`
}

Output is terraform module output value info

type Parser

type Parser interface {
	Parse() (*Module, error)
}

Parser represents a terraform module parser.

func NewParser

func NewParser(source string) (Parser, error)

type PrintOptions added in v0.1.1

type PrintOptions struct {
	Format       string
	IsNoDefaults bool
	IsNoOutputs  bool
}

type Printer added in v0.1.1

type Printer interface {
	Print() (string, error)
}

Printer is an interface to print terraform module.

func NewPrinter added in v0.1.1

func NewPrinter(m *Module, o *PrintOptions) (Printer, error)

type Resource

type Resource struct {
	Type string `hcl:"type,label"`
	Name string `hcl:"name,label"`
}

Resource is terraform module resource

type Variable

type Variable struct {
	Name        string          `hcl:"name,label"`
	Type        hclwrite.Tokens `hcl:"type,attr"`
	Description string          `hcl:"description,attr"`
	Default     hclwrite.Tokens `hcl:"default,attr"`
}

Variable is terraform module variable

Jump to

Keyboard shortcuts

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