func (state *Tfstate) GetModule(path ...string) *TfstateModule {
	for _, module := range state.Modules {
		if reflect.DeepEqual(module.Path, path) {
			return &module
		}
	}
	return nil
}
GetModule gets a module at a given path or nil if none exists for that path.
package wrapper
import (
	"encoding/json"
	"fmt"
	"reflect"
	"strings"
)
const (
	supportedTfStateVersion = 3
)
func NewTfstate(stateFile []byte) (*Tfstate, error) {
	state := Tfstate{}
	if err := json.Unmarshal(stateFile, &state); err != nil {
		return nil, err
	}
	if state.Version != supportedTfStateVersion {
		return nil, fmt.Errorf("unsupported tfstate version: %d", state.Version)
	}
	return &state, nil
}
type Tfstate struct {
	Version int             `json:"version"`
	Modules []TfstateModule `json:"modules"`
}