github.com/nathanielks/terraform@v0.6.1-0.20170509030759-13e1a62319dc/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  }