From 3b3421b77fddc05633482c68ff5ac04cd2b29576 Mon Sep 17 00:00:00 2001 From: chinthalapalli Date: Tue, 18 Jun 2024 22:47:57 +0530 Subject: [PATCH] adding fix for #994 --- bigip/resource_bigip_awaf_policy.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bigip/resource_bigip_awaf_policy.go b/bigip/resource_bigip_awaf_policy.go index f4604ad31..71f2f0dc2 100644 --- a/bigip/resource_bigip_awaf_policy.go +++ b/bigip/resource_bigip_awaf_policy.go @@ -11,6 +11,7 @@ import ( "fmt" "log" "os" + "reflect" "strings" "sync" "time" @@ -344,6 +345,16 @@ func resourceBigipAwafPolicy() *schema.Resource { Type: schema.TypeString, Optional: true, //Computed: true, + DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { + oldResp := []byte(old) + newResp := []byte(new) + oldJsonref := make(map[string]interface{}) + newJsonref := make(map[string]interface{}) + _ = json.Unmarshal(oldResp, &oldJsonref) + _ = json.Unmarshal(newResp, &newJsonref) + jsonEqualityBefore := reflect.DeepEqual(oldJsonref, newJsonref) + return jsonEqualityBefore + }, Description: "The payload of the WAF Policy to be used for IMPORT on to BIGIP", }, "policy_export_json": {