github.com/hartzell/terraform@v0.8.6-0.20180503104400-0cc9e050ecd4/helper/structure/suppress_json_diff.go (about)

     1  package structure
     2  
     3  import (
     4  	"reflect"
     5  
     6  	"github.com/hashicorp/terraform/helper/schema"
     7  )
     8  
     9  func SuppressJsonDiff(k, old, new string, d *schema.ResourceData) bool {
    10  	oldMap, err := ExpandJsonFromString(old)
    11  	if err != nil {
    12  		return false
    13  	}
    14  
    15  	newMap, err := ExpandJsonFromString(new)
    16  	if err != nil {
    17  		return false
    18  	}
    19  
    20  	return reflect.DeepEqual(oldMap, newMap)
    21  }