plan

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidDiskType = errors.New("not a valid DiskType")
View Source
var TfPlan *map[string]interface{}

TfPlan is the Terraform plan

Functions

func GetComputeResource added in v0.4.0

func GetComputeResource(resourceI interface{}, resourceMapping *ResourceMapping, resourcesResult []resources.Resource) ([]resources.Resource, error)

func GetResources

func GetResources(tfplan *map[string]interface{}) (map[string]resources.Resource, error)

GetResources returns the resources of the Terraform plan

Types

type DiskType added in v0.4.0

type DiskType int

ENUM(SSD, HDD)

const (
	// SSD is a DiskType of type SSD.
	SSD DiskType = iota
	// HDD is a DiskType of type HDD.
	HDD
)

func ParseDiskType added in v0.4.0

func ParseDiskType(name string) (DiskType, error)

ParseDiskType attempts to convert a string to a DiskType.

func (DiskType) MarshalText added in v0.4.0

func (x DiskType) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method.

func (DiskType) String added in v0.4.0

func (x DiskType) String() string

String implements the Stringer interface.

func (*DiskType) UnmarshalText added in v0.4.0

func (x *DiskType) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method.

type DiskTypes added in v0.4.0

type DiskTypes struct {
	Default *DiskType             `yaml:"default,omitempty"`
	Types   *map[string]*DiskType `yaml:"types,omitempty"`
}

type GeneralConfig added in v0.4.0

type GeneralConfig struct {
	JSONData         *map[string]interface{} `yaml:"json_data,omitempty"`
	DiskTypes        *DiskTypes              `yaml:"disk_types,omitempty"`
	IgnoredResources *[]string               `yaml:"ignored_resources,omitempty"`
}

type Mappings added in v0.4.0

type Mappings struct {
	General         *map[providers.Provider]GeneralConfig `yaml:"general,omitempty"`
	ComputeResource *map[string]ResourceMapping           `yaml:"compute_resource,omitempty"`
}

func GetMapping added in v0.4.0

func GetMapping() (*Mappings, error)

GetMapping returns the mapping of the terraform resources

type PropertyDefinition added in v0.4.0

type PropertyDefinition struct {
	Paths     []string           `yaml:"paths"`
	Unit      *string            `yaml:"unit,omitempty"`
	Default   interface{}        `yaml:"default,omitempty"`
	ValueType *string            `yaml:"value_type,omitempty"`
	Reference *Reference         `yaml:"reference,omitempty"`
	Regex     *Regex             `yaml:"regex,omitempty"`
	Item      *[]ResourceMapping `yaml:"item,omitempty"`
	Validator *string            `yaml:"validator,omitempty"`
}

type Reference added in v0.4.0

type Reference struct {
	General    string   `yaml:"general,omitempty"`
	JSONFile   string   `yaml:"json_file,omitempty"`
	Property   string   `yaml:"property,omitempty"`
	Paths      []string `yaml:"paths,omitempty"`
	ReturnPath bool     `yaml:"return_path,omitempty"`
}

type Regex added in v0.4.0

type Regex struct {
	Pattern string `yaml:"pattern"`
	Group   int    `yaml:"group"`
	Type    string `yaml:"type,omitempty"`
}

type ResourceMapping added in v0.4.0

type ResourceMapping struct {
	Paths      []string                         `yaml:"paths"`
	Type       string                           `yaml:"type"`
	Variables  *ResourceMapping                 `yaml:"variables,omitempty"`
	Properties *map[string][]PropertyDefinition `yaml:"properties"`
}

type UnsupportedDiskTypeError added in v0.4.0

type UnsupportedDiskTypeError struct {
	DiskType string
}

UnsupportedDiskTypeError is an error that occurs when a disk type is not supported

func (*UnsupportedDiskTypeError) Error added in v0.4.0

func (upe *UnsupportedDiskTypeError) Error() string

Jump to

Keyboard shortcuts

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