You can update a rule anytime by adding or updating the rule description, updating the rule expression, or adding or removing the outcome for the rule. When you update a rule a new rule version is created.
You can update a rule in the Amazon Fraud Detector console, using the update-rule-version
After you have updated the rule, make sure to update your detector version to use the new rule version.
Update rule in the Amazon Fraud Detector console
To update a rule,
-
Open the AWS Management Console
and sign in to your account. Navigate to Amazon Fraud Detector. -
In the left navigation pane, choose Detectors.
-
In the Detectors pane, select the detector that is associated with the rule you want to update.
-
In your detector page, choose Associated rules tab and select the rule you want to update.
-
In your rule page, choose Actions and select Create version.
-
Note that the version has changed. Enter updated description, expression, or outcome.
-
Choose Save new version
Update rule using the AWS SDK for Python (Boto3)
The following example code uses the UpdateRuleVersion API to
update the threshold for the rule high_risk
from 900 to 950. This rule is associated with the detector payments_detector
.
fraudDetector.update_rule_version(
rule = {
'detectorId' : 'payments_detector',
'ruleId' : 'high_risk',
'ruleVersion' : '1'
},
expression = '$sample_fraud_detection_model_insightscore > 950',
language = 'DETECTORPL',
outcomes = ['verify_customer']
)