terraform

package
v0.0.0-...-810c5a0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindStringInFiles

func FindStringInFiles(fs billy.Filesystem, files []string, searchString string) string

func Unpackfile

func Unpackfile(fs billy.Filesystem, file string, inputs []StateResources)

func Walk

func Walk(fs billy.Filesystem, fullPath string, paths []string) []string

Types

type EphemeralState

type EphemeralState struct {
	ConnInfo map[string]string `json:"-"`
	Type     string            `json:"-"`
}

type StateResources

type StateResources struct {
	ResourceType     string
	ResourceName     string
	ResourceLocation []string
	OldValue         string
	NewValue         string
	TFResource       string
}

func FindResources

func FindResources(State *TerraformState, Findings []recommender.Findings) []StateResources

type TerraformBackend

type TerraformBackend struct {
	Type   string
	Config map[string]interface{}
}

type TerraformInstanceState

type TerraformInstanceState struct {
	ID         string                 `json:"id"`
	Attributes map[string]string      `json:"attributes"`
	Ephemeral  EphemeralState         `json:"-"`
	Meta       map[string]interface{} `json:"meta"`
}

type TerraformModuleState

type TerraformModuleState struct {
	Path         []string                           `json:"path"`
	Locals       map[string]interface{}             `json:"-"`
	Outputs      map[string]*TerraformOutputState   `json:"outputs"`
	Resources    map[string]*TerraformResourceState `json:"resources"`
	Dependencies []string                           `json:"depends_on"`
}

type TerraformOutputState

type TerraformOutputState struct {
	Sensitive bool        `json:"sensitive"`
	Type      string      `json:"type"`
	Value     interface{} `json:"value"`
	// contains filtered or unexported fields
}

type TerraformResourceState

type TerraformResourceState struct {
	Type         string                    `json:"type"`
	Dependencies []string                  `json:"depends_on"`
	Primary      *TerraformInstanceState   `json:"primary"`
	Deposed      []*TerraformInstanceState `json:"deposed"`
	Provider     string                    `json:"provider"`
}

type TerraformState

type TerraformState struct {
	Version int
	Serial  int
	Backend *TerraformBackend
	Modules []TerraformModuleState
}

func ParseTerraformState

func ParseTerraformState(terraformStateData []byte) (*TerraformState, error)
func (state *TerraformState) Print() {
	fmt.Println(state.Version)
}
func (state *TerraformState) String() string {
	//fmt.Println(state.Modules)
	for _, module := range state.Modules {
		//fmt.Println(strings.Join(module.Path, "/"))
		fmt.Println(module.Path)
		for tfResource, resource := range module.Resources {
			fmt.Println(tfResource)
			fmt.Println(resource.Primary.ID)
			//		fmt.Println(resource.Primary.Attributes)
		}
	}
	return fmt.Sprintf("%d", state.Version)
}

Jump to

Keyboard shortcuts

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