tfmodule

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2020 License: MIT Imports: 10 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 NewModule

func NewModule(source string) *Module

NewModule returns a new module

func (*Module) PrintModuleAnalysis added in v0.1.0

func (m *Module) PrintModuleAnalysis() string

func (*Module) PrintModuleTemplate

func (m *Module) PrintModuleTemplate(isNoDefaults, isNoOutputs bool) string

func (*Module) String

func (m *Module) String() string

String returns module HCL expression

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 struct {
	// contains filtered or unexported fields
}

Parser represents a terraform module parser.

func NewParser

func NewParser() *Parser

NewParser return a new parser with given module source path.

func (*Parser) ParseTfModule

func (p *Parser) ParseTfModule(source string) (*Module, error)

ParseTfModule parses terraform module and returns module structs

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