terraform

package
v0.0.0-...-0c89093 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllTfCheckTypes

func AllTfCheckTypes() []string

func CheckTfFmt

func CheckTfFmt(dir string) (bool, string)

func CheckTfLint

func CheckTfLint(dir string) (bool, string, *formatter.JSONOutput)

func CheckTfValidate

func CheckTfValidate(dir string) (bool, string, *tfjson.ValidateOutput)

func FixFmt

func FixFmt(cloneDir string) error

func InitTfLint

func InitTfLint()

InitTfLint goal is to launch tflint --init once at program startup.

func TfLintRuleSeverityToAnnotationLevel

func TfLintRuleSeverityToAnnotationLevel(severity string) *string

TfLintRuleSeverityToAnnotationLevel allows to convert tflint severity to github annotation level.

func TfValidateSeverityToAnnotationLevel

func TfValidateSeverityToAnnotationLevel(severity tfjson.DiagnosticSeverity) *string

TfValidateSeverityToAnnotationLevel allows to convert terraform validate severity to github annotation level.

Types

type TfCheck

type TfCheck interface {
	Name() string
	Type() TfCheckType
	Run()
	Dir() string
	RelDir() string
	IsOK() bool
	Output() string
	FailureConclusion() githubv4.CheckConclusionState
	FixAction() *github.CheckRunAction
	Annotations() []*github.CheckRunAnnotation
}

TfCheck interface defines all functions that should be present for any TfCheck.

func GetTfChecks

func GetTfChecks(tfDir, relDir string, checkTypes []string) (checks []TfCheck)

func NewTfCheck

func NewTfCheck(checkType TfCheckType, tfDir, relDir string) TfCheck

type TfCheckFields

type TfCheckFields struct {
	// contains filtered or unexported fields
}

func NewTfCheckFields

func NewTfCheckFields(dir, relDir string) TfCheckFields

func (*TfCheckFields) Dir

func (t *TfCheckFields) Dir() string

func (*TfCheckFields) IsOK

func (t *TfCheckFields) IsOK() bool

func (*TfCheckFields) Output

func (t *TfCheckFields) Output() string

func (*TfCheckFields) RelDir

func (t *TfCheckFields) RelDir() string

type TfCheckFmt

type TfCheckFmt struct {
	TfCheckFields
}

func NewTfCheckFmt

func NewTfCheckFmt(tfDir, relDir string) *TfCheckFmt

func (*TfCheckFmt) Annotations

func (t *TfCheckFmt) Annotations() (annotations []*github.CheckRunAnnotation)

func (*TfCheckFmt) FailureConclusion

func (t *TfCheckFmt) FailureConclusion() githubv4.CheckConclusionState

func (*TfCheckFmt) FixAction

func (t *TfCheckFmt) FixAction() *github.CheckRunAction

func (*TfCheckFmt) Name

func (t *TfCheckFmt) Name() string

func (*TfCheckFmt) Run

func (t *TfCheckFmt) Run()

func (*TfCheckFmt) Type

func (t *TfCheckFmt) Type() TfCheckType

type TfCheckTfLint

type TfCheckTfLint struct {
	TfCheckFields
	// contains filtered or unexported fields
}

func NewTfCheckTfLint

func NewTfCheckTfLint(tfDir, relDir string) *TfCheckTfLint

func (*TfCheckTfLint) Annotations

func (t *TfCheckTfLint) Annotations() (annotations []*github.CheckRunAnnotation)

func (*TfCheckTfLint) FailureConclusion

func (t *TfCheckTfLint) FailureConclusion() githubv4.CheckConclusionState

func (*TfCheckTfLint) FixAction

func (t *TfCheckTfLint) FixAction() *github.CheckRunAction

func (*TfCheckTfLint) Name

func (t *TfCheckTfLint) Name() string

func (*TfCheckTfLint) Run

func (t *TfCheckTfLint) Run()

func (*TfCheckTfLint) Type

func (t *TfCheckTfLint) Type() TfCheckType

type TfCheckType

type TfCheckType int64

TfCheckType defines the different possible terraform checks.

const (
	Fmt TfCheckType = iota
	Validate
	TFLint
)

func TfCheckTypeFromString

func TfCheckTypeFromString(s string) TfCheckType

func (TfCheckType) String

func (t TfCheckType) String() string

type TfCheckValidate

type TfCheckValidate struct {
	TfCheckFields
	// contains filtered or unexported fields
}

func NewTfCheckValidate

func NewTfCheckValidate(tfDir, relDir string) *TfCheckValidate

func (*TfCheckValidate) Annotations

func (t *TfCheckValidate) Annotations() (annotations []*github.CheckRunAnnotation)

func (*TfCheckValidate) FailureConclusion

func (t *TfCheckValidate) FailureConclusion() githubv4.CheckConclusionState

func (*TfCheckValidate) FixAction

func (t *TfCheckValidate) FixAction() *github.CheckRunAction

func (*TfCheckValidate) Name

func (t *TfCheckValidate) Name() string

func (*TfCheckValidate) Run

func (t *TfCheckValidate) Run()

func (*TfCheckValidate) Type

func (t *TfCheckValidate) Type() TfCheckType

type TfDir

type TfDir struct {
	// contains filtered or unexported fields
}

func FindAllTfDir

func FindAllTfDir(dir string) (tfDirs []*TfDir)

FindAllTfDir finds all of the terraform directory inside a directory.

func NewTfDir

func NewTfDir(path string) *TfDir

func (*TfDir) IsEnabled

func (t *TfDir) IsEnabled() bool

func (*TfDir) Path

func (t *TfDir) Path() string

type TfDirConfigFile

type TfDirConfigFile struct {
	Enabled bool `yaml:"enabled"`
}

Jump to

Keyboard shortcuts

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