parser

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChildModule

type ChildModule struct {
	Address      string            `json:"address"`
	Resources    []PlannedResource `json:"resources"`
	ChildModules []ChildModule     `json:"child_modules"`
}

type ParseResult

type ParseResult struct {
	Resources []Resource
	Errors    []error
}

func ParseTerraformFiles

func ParseTerraformFiles(paths []string) (*ParseResult, error)

func ParseTerraformPlan

func ParseTerraformPlan(filename string) (*ParseResult, error)

ParseTerraformPlan parses a terraform plan JSON file and extracts resources with tags

type PlanResource

type PlanResource struct {
	Type    string
	Name    string
	Tags    map[string]string
	File    string
	Address string
}

PlanResource is used for resources parsed from terraform plan

type PlannedResource

type PlannedResource struct {
	Address    string                 `json:"address"`
	Type       string                 `json:"type"`
	Name       string                 `json:"name"`
	Values     map[string]interface{} `json:"values"`
	ModulePath []string               `json:"module_path,omitempty"`
}

type PlannedValues

type PlannedValues struct {
	RootModule RootModule `json:"root_module"`
}

type Resource

type Resource struct {
	Type     string
	Name     string
	Tags     map[string]string
	Location hcl.Range
	File     string
}

type RootModule

type RootModule struct {
	Resources    []PlannedResource `json:"resources"`
	ChildModules []ChildModule     `json:"child_modules"`
}

type TerraformPlan

type TerraformPlan struct {
	PlannedValues PlannedValues `json:"planned_values"`
}

TerraformPlan represents the structure of terraform plan JSON output

Jump to

Keyboard shortcuts

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