Documentation ¶
Index ¶
- func FindStringInFiles(fs billy.Filesystem, files []string, searchString string) string
- func Unpackfile(fs billy.Filesystem, file string, inputs []StateResources)
- func Walk(fs billy.Filesystem, fullPath string, paths []string) []string
- type EphemeralState
- type StateResources
- type TerraformBackend
- type TerraformInstanceState
- type TerraformModuleState
- type TerraformOutputState
- type TerraformResourceState
- type TerraformState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindStringInFiles ¶
func Unpackfile ¶
func Unpackfile(fs billy.Filesystem, file string, inputs []StateResources)
Types ¶
type EphemeralState ¶
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 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 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) }
Click to show internal directories.
Click to hide internal directories.