detector_versions
Creates, updates, deletes, gets or lists a detector_versions resource.
Overview
| Name | detector_versions |
| Type | Resource |
| Id | aws.frauddetector.detector_versions |
Fields
The following fields are returned by SELECT queries:
- get_detector_version
| Name | Datatype | Description |
|---|---|---|
arn | string | The detector version ARN. (pattern: <code>^arn:aws[a-z-]{0,15}:frauddetector:[a-z0-9-]{3,20}:[0-9]{12}:[^\s]{2,128}$</code>) |
created_time | string | The timestamp when the detector version was created. |
description | string | The detector version description. |
detector_id | string | The detector ID. (pattern: <code>^[0-9a-z_-]+$</code>) |
detector_version_id | string | The detector version ID. (pattern: <code>^([1-9][0-9]*)$</code>) |
external_model_endpoints | array | The Amazon SageMaker model endpoints included in the detector version. |
last_updated_time | string | The timestamp when the detector version was last updated. |
model_versions | array | The model versions included in the detector version. |
rule_execution_mode | string | The execution mode of the rule in the dectector FIRST_MATCHED indicates that Amazon Fraud Detector evaluates rules sequentially, first to last, stopping at the first matched rule. Amazon Fraud dectector then provides the outcomes for that single rule. ALL_MATCHED indicates that Amazon Fraud Detector evaluates all rules and returns the outcomes for all matched rules. You can define and edit the rule mode at the detector version level, when it is in draft status. (ALL_MATCHED, FIRST_MATCHED) |
rules | array | The rules included in the detector version. |
status | string | The status of the detector version. (DRAFT, ACTIVE, INACTIVE) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_detector_version | select | region | Gets a particular detector version. | |
create_detector_version | insert | region, detectorId, rules | Creates a detector version. The detector version starts in a DRAFT status. | |
update_detector_version | update | region, detectorId, detectorVersionId, externalModelEndpoints, rules | Updates a detector version. The detector version attributes that you can update include models, external model endpoints, rules, rule execution mode, and description. You can only update a DRAFT detector version. | |
update_detector_version_metadata | update | region, detectorId, detectorVersionId, description | Updates the detector version's description. You can update the metadata for any detector version (DRAFT, ACTIVE, or INACTIVE). | |
update_detector_version_status | update | region, detectorId, detectorVersionId, status | Updates the detector version’s status. You can perform the following promotions or demotions using UpdateDetectorVersionStatus: DRAFT to ACTIVE, ACTIVE to INACTIVE, and INACTIVE to ACTIVE. | |
delete_detector_version | delete | region | Deletes the detector version. You cannot delete detector versions that are in ACTIVE status. When you delete a detector version, Amazon Fraud Detector permanently deletes the detector and the data is no longer stored in Amazon Fraud Detector. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_detector_version
Gets a particular detector version.
SELECT
arn,
created_time,
description,
detector_id,
detector_version_id,
external_model_endpoints,
last_updated_time,
model_versions,
rule_execution_mode,
rules,
status
FROM aws.frauddetector.detector_versions
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_detector_version
- Manifest
Creates a detector version. The detector version starts in a DRAFT status.
INSERT INTO aws.frauddetector.detector_versions (
detectorId,
description,
externalModelEndpoints,
rules,
modelVersions,
ruleExecutionMode,
tags,
region
)
SELECT
'{{ detectorId }}' /* required */,
'{{ description }}',
'{{ externalModelEndpoints }}',
'{{ rules }}' /* required */,
'{{ modelVersions }}',
'{{ ruleExecutionMode }}',
'{{ tags }}',
'{{ region }}'
RETURNING
detector_id,
detector_version_id,
status
;
# Description fields are for documentation purposes
- name: detector_versions
props:
- name: region
value: "{{ region }}"
description: Required parameter for the detector_versions resource.
- name: detectorId
value: "{{ detectorId }}"
description: |
The ID of the detector under which you want to create a new version.
- name: description
value: "{{ description }}"
description: |
The description of the detector version.
- name: externalModelEndpoints
value:
- "{{ externalModelEndpoints }}"
description: |
The Amazon Sagemaker model endpoints to include in the detector version.
- name: rules
description: |
The rules to include in the detector version.
value:
- detectorId: "{{ detectorId }}"
ruleId: "{{ ruleId }}"
ruleVersion: "{{ ruleVersion }}"
- name: modelVersions
description: |
The model versions to include in the detector version.
value:
- modelId: "{{ modelId }}"
modelType: "{{ modelType }}"
modelVersionNumber: "{{ modelVersionNumber }}"
arn: "{{ arn }}"
- name: ruleExecutionMode
value: "{{ ruleExecutionMode }}"
description: |
The rule execution mode for the rules included in the detector version. You can define and edit the rule mode at the detector version level, when it is in draft status. If you specify FIRST_MATCHED, Amazon Fraud Detector evaluates rules sequentially, first to last, stopping at the first matched rule. Amazon Fraud dectector then provides the outcomes for that single rule. If you specifiy ALL_MATCHED, Amazon Fraud Detector evaluates all rules and returns the outcomes for all matched rules. The default behavior is FIRST_MATCHED.
valid_values: ['ALL_MATCHED', 'FIRST_MATCHED']
- name: tags
description: |
A collection of key and value pairs.
value:
- key: "{{ key }}"
value: "{{ value }}"
UPDATE examples
- update_detector_version
- update_detector_version_metadata
- update_detector_version_status
Updates a detector version. The detector version attributes that you can update include models, external model endpoints, rules, rule execution mode, and description. You can only update a DRAFT detector version.
UPDATE aws.frauddetector.detector_versions
SET
detectorId = '{{ detectorId }}',
detectorVersionId = '{{ detectorVersionId }}',
externalModelEndpoints = '{{ externalModelEndpoints }}',
rules = '{{ rules }}',
description = '{{ description }}',
modelVersions = '{{ modelVersions }}',
ruleExecutionMode = '{{ ruleExecutionMode }}'
WHERE
region = '{{ region }}' --required
AND detectorId = '{{ detectorId }}' --required
AND detectorVersionId = '{{ detectorVersionId }}' --required
AND externalModelEndpoints = '{{ externalModelEndpoints }}' --required
AND rules = '{{ rules }}' --required;
Updates the detector version's description. You can update the metadata for any detector version (DRAFT, ACTIVE, or INACTIVE).
UPDATE aws.frauddetector.detector_versions
SET
detectorId = '{{ detectorId }}',
detectorVersionId = '{{ detectorVersionId }}',
description = '{{ description }}'
WHERE
region = '{{ region }}' --required
AND detectorId = '{{ detectorId }}' --required
AND detectorVersionId = '{{ detectorVersionId }}' --required
AND description = '{{ description }}' --required;
Updates the detector version’s status. You can perform the following promotions or demotions using UpdateDetectorVersionStatus: DRAFT to ACTIVE, ACTIVE to INACTIVE, and INACTIVE to ACTIVE.
UPDATE aws.frauddetector.detector_versions
SET
detectorId = '{{ detectorId }}',
detectorVersionId = '{{ detectorVersionId }}',
status = '{{ status }}'
WHERE
region = '{{ region }}' --required
AND detectorId = '{{ detectorId }}' --required
AND detectorVersionId = '{{ detectorVersionId }}' --required
AND status = '{{ status }}' --required;
DELETE examples
- delete_detector_version
Deletes the detector version. You cannot delete detector versions that are in ACTIVE status. When you delete a detector version, Amazon Fraud Detector permanently deletes the detector and the data is no longer stored in Amazon Fraud Detector.
DELETE FROM aws.frauddetector.detector_versions
WHERE region = '{{ region }}' --required
;