Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions parser.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package main


import (
"encoding/json"
"fmt"
Expand Down Expand Up @@ -289,6 +290,11 @@ func encodeTerraform0Dot12ValuesAsAttributes(rawValues *map[string]interface{})
for kk, vv := range v {
if str, typeOk := vv.(string); typeOk {
ret[k+"."+strconv.Itoa(kk)] = str
} else if mi, typeOk := vv.(map[string]interface{}); typeOk {
attribs := encodeTerraform0Dot12ValuesAsAttributes(&mi)
for k3, v3 := range attribs {
ret[k+"."+strconv.Itoa(kk)+"."+k3] = v3
}
} else {
ret[k+"."+strconv.Itoa(kk)] = "<error>"
}
Expand All @@ -312,7 +318,6 @@ func (s *stateTerraform0dot12) resources() []*Resource {
if !typeOk {
continue
}

if strings.HasPrefix(rs.Address, "data.") {
// This does not represent a host (e.g. AWS AMI)
continue
Expand All @@ -326,7 +331,6 @@ func (s *stateTerraform0dot12) resources() []*Resource {
if rs.Index != nil {
resourceKeyName += "." + strconv.Itoa(*rs.Index)
}

// Terraform stores resources in a name->map map, but we need the name to
// decide which groups to include the resource in. So wrap it in a higher-
// level object with both properties.
Expand Down