plan

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package plan contains the logic for parsing a Terraform plan into a normalized diff

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeWarning

type ChangeWarning struct {
	ChangeType string `json:"change_type"`
	Message    string `json:"message"`
	Line       int32  `json:"line"`
}

ChangeWarning describes a warning that occurred during a plan

type Diff

type Diff struct {
	Resources []*ResourceDiff `json:"resources"`
	Outputs   []*OutputDiff   `json:"outputs"`
}

Diff is a model for a normalized diff

type MockParser

type MockParser struct {
	mock.Mock
}

MockParser is an autogenerated mock type for the Parser type

func NewMockParser

func NewMockParser(t mockConstructorTestingTNewMockParser) *MockParser

NewMockParser creates a new instance of MockParser. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*MockParser) Parse

func (_m *MockParser) Parse(plan *tfjson.Plan, schemas *tfjson.ProviderSchemas) (*Diff, error)

Parse provides a mock function with given fields: plan, schemas

type OutputDiff

type OutputDiff struct {
	Action         action.Action    `json:"action"`
	OutputName     string           `json:"output_name"`
	UnifiedDiff    string           `json:"unified_diff"`
	OriginalSource string           `json:"original_source"`
	Warnings       []*ChangeWarning `json:"warnings"`
}

OutputDiff is a model for an output diff

type Parser

type Parser interface {
	Parse(plan *tjson.Plan, schemas *tjson.ProviderSchemas) (*Diff, error)
}

Parser is used to extract a normalized diff from a terraform plan

func NewParser

func NewParser() Parser

NewParser creates a new parser for the given plan and provider schemas

type ResourceDiff

type ResourceDiff struct {
	Mode           string           `json:"mode"`
	Address        string           `json:"address"`
	ResourceType   string           `json:"resource_type"`
	ResourceName   string           `json:"resource_name"`
	ProviderName   string           `json:"provider_name"`
	ModuleAddress  string           `json:"module_address"`
	Action         action.Action    `json:"action"`
	UnifiedDiff    string           `json:"unified_diff"`
	OriginalSource string           `json:"original_source"`
	Warnings       []*ChangeWarning `json:"warnings"`
	Imported       bool             `json:"imported"`
	Drifted        bool             `json:"drifted"`
	Moved          bool             `json:"moved"`
}

ResourceDiff is a model for a resource diff

Directories

Path Synopsis
Package action provider action constants and utilities.
Package action provider action constants and utilities.
Package collections provides utilities for working with collections inside of plan
Package collections provides utilities for working with collections inside of plan
Package computed contains types that represent the computed diffs for Terraform blocks, attributes, and outputs.
Package computed contains types that represent the computed diffs for Terraform blocks, attributes, and outputs.
node
Package node provides the rendered node types
Package node provides the rendered node types
renderers
Package renderers provides the rendering logic for computed diffs
Package renderers provides the rendering logic for computed diffs
Package differ provides the logic for converting a changed into a computed diff
Package differ provides the logic for converting a changed into a computed diff
Package jsondiff provides utilities for working with JSON types
Package jsondiff provides utilities for working with JSON types
Package structured contains the structured representation of the JSON changes returned by the tjson package.
Package structured contains the structured representation of the JSON changes returned by the tjson package.
attributepath
Package attributepath provides a way to match paths for replace and sensitive attributes
Package attributepath provides a way to match paths for replace and sensitive attributes
Package visitor provides a visitor pattern for traversing the plan and rendering the hcl diff
Package visitor provides a visitor pattern for traversing the plan and rendering the hcl diff

Jump to

Keyboard shortcuts

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