// Suppress diffs for blocks where one version is completely unset and the other is set
// to an empty block. This might occur in situations where removing a block completely
// is impossible (if it's computed or part of an AtLeastOneOf), so instead the user sets
// its values to empty.
Suppress diffs for blocks where one version is completely unset and the other is set
to an empty block. This might occur in situations where removing a block completely
is impossible (if it's computed or part of an AtLeastOneOf), so instead the user sets
its values to empty.
// Suppress diffs for blocks where one version is completely unset and the other is set // to an empty block . This might occur in situations where removing a block completely // is impossible ( if it ' s computed or part of an AtLeastOneOf ) so instead the user sets // its values to empty .
func emptyOrUnsetBlockDiffSuppress(k, old, new string, d *schema.ResourceData) bool {
	o, n := d.GetChange(strings.TrimSuffix(k, ".#"))
	var l []interface{}
	if old == "0" && new == "1" {
		l = n.([]interface{})
	} else if new == "0" && old == "1" {
		l = o.([]interface{})
	} else {
		return false
	}
	contents := l[0].(map[string]interface{})
	for _, v := range contents {
		if !isEmptyValue(reflect.ValueOf(v)) {
			return false
		}
	}
	return true
}
func emptyOrUnsetBlockDiffSuppress ( k , old , new string , d * schema . ResourceData ) bool { o , n := d . GetChange ( strings . TrimSuffix ( k , " " ) ) var l [ ] interface { } if old == " " && new == " " { l = n . ( [ ] interface { } ) } else if new == " " && old == " " { l = o . ( [ ] interface { } ) } else { return false } contents := l [ 0 ] . ( map [ string ] interface { } ) for _ , v := range contents { if ! isEmptyValue ( reflect . ValueOf ( v ) ) { return false } } return true }
Suppress diffs for blocks where one version is completely unset and the other is set
to an empty block.
Suppress diffs for blocks where one version is completely unset and the other is set to an empty block .
// we don't have one set and one unset, so don't suppress the diff