Skip to content

CustomDataIdentifier

Source: src/AWS/Macie2/CustomDataIdentifier.ts

An Amazon Macie custom data identifier — a regex-based detection criterion (with optional keywords, ignore words, and severity thresholds) that classification jobs and automated discovery use to detect organization- specific sensitive data. Requires Macie to be enabled for the account (see Macie2.Session). Definitions are immutable: any change other than tags replaces the identifier. Destroy soft-deletes it.

Employee-id detector

const identifier = yield* Macie2.CustomDataIdentifier("EmployeeId", {
regex: "EMP-[0-9]{8}",
description: "Internal employee id format",
});

Keyword-scoped detector with severity thresholds

const identifier = yield* Macie2.CustomDataIdentifier("AccountNumber", {
regex: "[0-9]{12}",
keywords: ["account number", "acct no"],
maximumMatchDistance: 30,
severityLevels: [
{ occurrencesThreshold: 1, severity: "LOW" },
{ occurrencesThreshold: 25, severity: "HIGH" },
],
});