hcl

package
v0.0.0-...-6477f42 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package hcl handle the parsing of your terraform file

Package hcl handle the parsing of your terraform file

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TerraformBlockIsEmpty

func TerraformBlockIsEmpty(terraform Terraform) bool

TerraformBlockIsEmpty return true if terraform variable is empty else false

Types

type Data

type Data nameType

Data get all needed information of data blocks for terraform-validator

type Locals

type Locals []string

Locals get all needed information of Locals config blocks for terraform-validator

type Module

type Module nameVersion

Module get all needed information of module blocks for terraform-validator

type Output

type Output nameDescription

Output get all needed information of output blocks for terraform-validator

type ParsedFile

type ParsedFile struct {
	Name   string
	Blocks TerraformBlocks
}

ParsedFile get all needed information of all blocks for terraform-validator

func GetFolderParsedContents

func GetFolderParsedContents(path string) []ParsedFile

GetFolderParsedContents returns you a []ParsedFile that define every file inside the given path

func GetParsedContent

func GetParsedContent(f fs.File) ParsedFile

GetParsedContent will parse a file for you and return the associated ParsedFile

func (ParsedFile) GetBlockNamesByType

func (parsedfile ParsedFile) GetBlockNamesByType() map[string][]string

GetBlockNamesByType return you a map[string][]string defining the blocktypes present in the given parsedfile and the blocknames for each blocktype

type Provider

type Provider nameVersion

Provider get all needed information of provider blocks for terraform-validator

type Resource

type Resource nameType

Resource get all needed information of resource blocks for terraform-validator

type Terraform

type Terraform struct {
	Version           string
	Backend           string
	RequiredProviders map[string]string
}

Terraform get all needed information of terraform config blocks for terraform-validator

type TerraformBlocks

type TerraformBlocks struct {
	Variables []Variable
	Terraform Terraform
	Modules   []Module
	Providers []Provider
	Data      []Data
	Resources []Resource
	Locals    []Locals
	Outputs   []Output
}

TerraformBlocks is the structure that define a whole terraform file and contains all the blocks informations needed by terraform-validator

type Variable

type Variable nameDescription

Variable get all needed information of variable blocks for terraform-validator

Jump to

Keyboard shortcuts

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