Documentation ¶
Index ¶
Constants ¶
const ( // DefaultPlanTemplate is a default template for terraform plan DefaultPlanTemplate = `` /* 295-byte string literal not displayed */ // DefaultApplyTemplate is a default template for terraform apply DefaultApplyTemplate = `` /* 281-byte string literal not displayed */ // DefaultPlanParseErrorTemplate is a default template for terraform plan parse error DefaultPlanParseErrorTemplate = `` /* 190-byte string literal not displayed */ // DefaultApplyParseErrorTemplate is a default template for terraform apply parse error DefaultApplyParseErrorTemplate = `` /* 233-byte string literal not displayed */ )
const ( // ExitPass is status code zero ExitPass int = iota // ExitFail is status code non-zero ExitFail )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplyParser ¶
ApplyParser is a parser for terraform apply
func NewApplyParser ¶
func NewApplyParser() *ApplyParser
NewApplyParser is ApplyParser initialized with its Regexp
func (*ApplyParser) Parse ¶
func (p *ApplyParser) Parse(body string) ParseResult
Parse returns ParseResult related with terraform apply
type CommonTemplate ¶
type CommonTemplate struct { Result string ChangedResult string ChangeOutsideTerraform string Warning string Link string UseRawOutput bool HasDestroy bool HasError bool Vars map[string]string Templates map[string]string Stdout string Stderr string CombinedOutput string ExitCode int ErrorMessages []string CreatedResources []string UpdatedResources []string DeletedResources []string ReplacedResources []string MovedResources []*MovedResource ImportedResources []string }
CommonTemplate represents template entities
type MovedResource ¶
type ParseResult ¶
type ParseResult struct { Result string OutsideTerraform string ChangedResult string Warning string HasAddOrUpdateOnly bool HasDestroy bool HasNoChanges bool HasError bool HasParseError bool Error error CreatedResources []string UpdatedResources []string DeletedResources []string ReplacedResources []string MovedResources []*MovedResource ImportedResources []string }
ParseResult represents the result of parsed terraform execution
type Parser ¶
type Parser interface {
Parse(body string) ParseResult
}
Parser is an interface for parsing terraform execution result
type PlanParser ¶
type PlanParser struct { Pass *regexp.Regexp Fail *regexp.Regexp Warning *regexp.Regexp OutputsChanges *regexp.Regexp HasDestroy *regexp.Regexp HasNoChanges *regexp.Regexp Create *regexp.Regexp Update *regexp.Regexp Delete *regexp.Regexp Replace *regexp.Regexp ReplaceOption *regexp.Regexp Move *regexp.Regexp Import *regexp.Regexp ImportedFrom *regexp.Regexp MovedFrom *regexp.Regexp }
PlanParser is a parser for terraform plan
func NewPlanParser ¶
func NewPlanParser() *PlanParser
NewPlanParser is PlanParser initialized with its Regexp
func (*PlanParser) Parse ¶
func (p *PlanParser) Parse(body string) ParseResult
Parse returns ParseResult related with terraform plan
type Template ¶
type Template struct { Template string CommonTemplate }
Template is a default template for terraform commands
func NewApplyTemplate ¶
NewApplyTemplate is ApplyTemplate initializer
func NewPlanTemplate ¶
NewPlanTemplate is PlanTemplate initializer
func (*Template) SetValue ¶
func (t *Template) SetValue(ct CommonTemplate)
SetValue sets template entities to CommonTemplate