terraform/helper/structure/suppress_json_diff.go

22 lines
364 B
Go
Raw Normal View History

2017-03-28 13:45:28 +02:00
package structure
import (
"reflect"
"github.com/hashicorp/terraform/helper/schema"
)
func SuppressJsonDiff(k, old, new string, d *schema.ResourceData) bool {
oldMap, err := ExpandJsonFromString(old)
if err != nil {
return false
}
newMap, err := ExpandJsonFromString(new)
if err != nil {
return false
}
return reflect.DeepEqual(oldMap, newMap)
}