diff --git a/datadog/resource_datadog_sensitive_data_scanner_rule.go b/datadog/resource_datadog_sensitive_data_scanner_rule.go index 407ccd6798..df894bacda 100644 --- a/datadog/resource_datadog_sensitive_data_scanner_rule.go +++ b/datadog/resource_datadog_sensitive_data_scanner_rule.go @@ -455,13 +455,9 @@ func updateSensitiveDataScannerRuleState(d *schema.ResourceData, ruleAttributes if replacementString, ok := tR.GetReplacementStringOk(); ok { textReplacement["replacement_string"] = replacementString } - if tR.AdditionalProperties != nil { - // `should_save_match` should be supported starting in `datadog-api-client-go` v2.45 - // Additional properties is used until then. - if shouldSaveMatch, ok := tR.AdditionalProperties["should_save_match"]; ok { - if replacementType, ok := tR.GetTypeOk(); ok && *replacementType == datadogV2.SENSITIVEDATASCANNERTEXTREPLACEMENTTYPE_REPLACEMENT_STRING { - textReplacement["should_save_match"] = shouldSaveMatch - } + if shouldSaveMatch, ok := tR.GetShouldSaveMatchOk(); ok { + if replacementType, ok := tR.GetTypeOk(); ok && *replacementType == datadogV2.SENSITIVEDATASCANNERTEXTREPLACEMENTTYPE_REPLACEMENT_STRING { + textReplacement["should_save_match"] = shouldSaveMatch } } if replacementType, ok := tR.GetTypeOk(); ok {