Skip to content

AWS.EntityResolution reference

Source: packages/aws/src/EntityResolution/BatchDeleteUniqueId.ts

Runtime binding for entityresolution:BatchDeleteUniqueId.

Deletes unique IDs (and their match associations) from the bound matching workflow’s internal match store. Provide the implementation with Effect.provide(AWS.EntityResolution.BatchDeleteUniqueIdHttp).

// init — bind the operation to the workflow
const batchDeleteUniqueId = yield* AWS.EntityResolution.BatchDeleteUniqueId(workflow);
// runtime
const { deleted, errors } = yield* batchDeleteUniqueId({
uniqueIds: ["1", "2"],
});

Source: packages/aws/src/EntityResolution/GenerateMatchId.ts

Runtime binding for entityresolution:GenerateMatchId.

Generates or retrieves Match IDs for records submitted in real time against the bound rule-based matching workflow: existing records return their Match IDs, unmatched records get new ones. Provide the implementation with Effect.provide(AWS.EntityResolution.GenerateMatchIdHttp).

// init — bind the operation to the workflow
const generateMatchId = yield* AWS.EntityResolution.GenerateMatchId(workflow);
// runtime
const { matchGroups } = yield* generateMatchId({
records: [
{
inputSourceARN: table.tableArn,
uniqueId: "1",
recordAttributeMap: { id: "1", email: "jane@example.com" },
},
],
});

Source: packages/aws/src/EntityResolution/GetIdMappingJob.ts

Runtime binding for entityresolution:GetIdMappingJob.

Reads the status, metrics, and errors of an ID mapping job run of the bound workflow. Provide the implementation with Effect.provide(AWS.EntityResolution.GetIdMappingJobHttp).

// init — bind the operation to the workflow
const getIdMappingJob = yield* AWS.EntityResolution.GetIdMappingJob(workflow);
// runtime
const job = yield* getIdMappingJob({ jobId });
console.log(job.status, job.metrics?.totalMappedRecords);

Source: packages/aws/src/EntityResolution/GetMatchId.ts

Runtime binding for entityresolution:GetMatchId.

Returns the Match ID of a customer record if it has already been processed by the bound rule-based matching workflow — a read-only dry run of an incremental load. Provide the implementation with Effect.provide(AWS.EntityResolution.GetMatchIdHttp).

// init — bind the operation to the workflow
const getMatchId = yield* AWS.EntityResolution.GetMatchId(workflow);
// runtime
const { matchId, matchRule } = yield* getMatchId({
record: { id: "1", email: "jane@example.com" },
});

Source: packages/aws/src/EntityResolution/GetMatchingJob.ts

Runtime binding for entityresolution:GetMatchingJob.

Reads the status, metrics, and errors of a matching job run of the bound workflow. Provide the implementation with Effect.provide(AWS.EntityResolution.GetMatchingJobHttp).

// init — bind the operation to the workflow
const getMatchingJob = yield* AWS.EntityResolution.GetMatchingJob(workflow);
// runtime
const job = yield* getMatchingJob({ jobId });
console.log(job.status, job.metrics?.matchIDs);

Source: packages/aws/src/EntityResolution/IdMappingWorkflow.ts

An AWS Entity Resolution ID mapping workflow — a data-processing job definition that translates record identifiers between a SOURCE and a TARGET ID namespace, using rule-based matching or a provider service.

The workflow definition itself is cheap and instant; a mapping RUN (StartIdMappingJob) processes the full input and takes many minutes.

IdMappingWorkflow: Creating ID Mapping Workflows

Section titled “IdMappingWorkflow: Creating ID Mapping Workflows”
import * as AWS from "@alchemy.run/aws";
const workflow = yield* AWS.EntityResolution.IdMappingWorkflow("Map", {
inputSourceConfig: [
{ inputSourceARN: source.idNamespaceArn, type: "SOURCE" },
{ inputSourceARN: target.idNamespaceArn, type: "TARGET" },
],
idMappingTechniques: {
idMappingType: "RULE_BASED",
ruleBasedProperties: {
ruleDefinitionType: "TARGET",
attributeMatchingModel: "ONE_TO_ONE",
recordMatchingModel: "ONE_SOURCE_TO_ONE_TARGET",
},
},
outputSourceConfig: [
{ outputS3Path: `s3://${bucket.bucketName}/idmapping/` },
],
roleArn: role.roleArn,
});

IdMappingWorkflow: Looking up an existing id mapping workflow

Section titled “IdMappingWorkflow: Looking up an existing id mapping workflow”

IdMappingWorkflow.lookup references an id mapping workflow Alchemy doesn’t manage (created in the console or by another stack), found by workflowName. It is read during plan/deploy and never created, updated or deleted.

const existing = AWS.EntityResolution.IdMappingWorkflow.lookup({ workflowName: "my-id-mapping-workflow" });

Source: packages/aws/src/EntityResolution/IdNamespace.ts

An AWS Entity Resolution ID namespace — a wrapper around an input dataset used by ID mapping workflows. A SOURCE namespace holds the records to be translated; a TARGET namespace holds the dataset (and the rule-based matching configuration) they are mapped onto.

Source namespace over a Glue table

import * as AWS from "@alchemy.run/aws";
const source = yield* AWS.EntityResolution.IdNamespace("Source", {
type: "SOURCE",
inputSourceConfig: [
{ inputSourceARN: table.tableArn, schemaName: schema.schemaName },
],
idMappingWorkflowProperties: [{ idMappingType: "RULE_BASED" }],
roleArn: role.roleArn,
});

Target namespace with matching rules

const target = yield* AWS.EntityResolution.IdNamespace("Target", {
type: "TARGET",
inputSourceConfig: [
{ inputSourceARN: table.tableArn, schemaName: schema.schemaName },
],
idMappingWorkflowProperties: [
{
idMappingType: "RULE_BASED",
ruleBasedProperties: {
rules: [{ ruleName: "ByEmail", matchingKeys: ["email"] }],
ruleDefinitionTypes: ["TARGET"],
attributeMatchingModel: "ONE_TO_ONE",
recordMatchingModels: ["ONE_SOURCE_TO_ONE_TARGET"],
},
},
],
roleArn: role.roleArn,
});

IdNamespace: Looking up an existing id namespace

Section titled “IdNamespace: Looking up an existing id namespace”

IdNamespace.lookup references an id namespace Alchemy doesn’t manage (created in the console or by another stack), found by idNamespaceName. It is read during plan/deploy and never created, updated or deleted.

const existing = AWS.EntityResolution.IdNamespace.lookup({ idNamespaceName: "my-id-namespace" });

Source: packages/aws/src/EntityResolution/ListIdMappingJobs.ts

Runtime binding for entityresolution:ListIdMappingJobs.

Lists the ID mapping job runs of the bound workflow. Provide the implementation with Effect.provide(AWS.EntityResolution.ListIdMappingJobsHttp).

ListIdMappingJobs: Running ID Mapping Jobs

Section titled “ListIdMappingJobs: Running ID Mapping Jobs”
// init — bind the operation to the workflow
const listIdMappingJobs = yield* AWS.EntityResolution.ListIdMappingJobs(workflow);
// runtime
const { jobs } = yield* listIdMappingJobs({});

Source: packages/aws/src/EntityResolution/ListMatchingJobs.ts

Runtime binding for entityresolution:ListMatchingJobs.

Lists the matching job runs of the bound workflow. Provide the implementation with Effect.provide(AWS.EntityResolution.ListMatchingJobsHttp).

// init — bind the operation to the workflow
const listMatchingJobs = yield* AWS.EntityResolution.ListMatchingJobs(workflow);
// runtime
const { jobs } = yield* listMatchingJobs({});

Source: packages/aws/src/EntityResolution/MatchingWorkflow.ts

An AWS Entity Resolution matching workflow — a data-processing job definition that matches and deduplicates records across Glue table input sources using rule-based or ML-powered matching, writing matched record groups to S3.

The workflow definition itself is cheap and instant; a matching RUN (StartMatchingJob) processes the full input and takes many minutes.

Rule-based matching over a Glue table

import * as AWS from "@alchemy.run/aws";
const workflow = yield* AWS.EntityResolution.MatchingWorkflow("Dedupe", {
inputSourceConfig: [
{ inputSourceARN: table.tableArn, schemaName: schema.schemaName },
],
outputSourceConfig: [
{
outputS3Path: `s3://${bucket.bucketName}/matches/`,
output: [{ name: "id" }, { name: "email" }],
},
],
resolutionTechniques: {
resolutionType: "RULE_MATCHING",
ruleBasedProperties: {
rules: [{ ruleName: "ByEmail", matchingKeys: ["email"] }],
attributeMatchingModel: "ONE_TO_ONE",
},
},
roleArn: role.roleArn,
});

ML-powered matching

const workflow = yield* AWS.EntityResolution.MatchingWorkflow("MlDedupe", {
inputSourceConfig: [
{ inputSourceARN: table.tableArn, schemaName: schema.schemaName },
],
outputSourceConfig: [
{
outputS3Path: `s3://${bucket.bucketName}/ml-matches/`,
output: [{ name: "id" }],
},
],
resolutionTechniques: { resolutionType: "ML_MATCHING" },
roleArn: role.roleArn,
});

MatchingWorkflow: Looking up an existing matching workflow

Section titled “MatchingWorkflow: Looking up an existing matching workflow”

MatchingWorkflow.lookup references a matching workflow Alchemy doesn’t manage (created in the console or by another stack), found by workflowName. It is read during plan/deploy and never created, updated or deleted.

const existing = AWS.EntityResolution.MatchingWorkflow.lookup({ workflowName: "my-matching-workflow" });

Source: packages/aws/src/EntityResolution/SchemaMapping.ts

An AWS Entity Resolution schema mapping — the schema of an input customer records table. It tells Entity Resolution the attribute type of each column (name, email, phone, unique id, …) and which columns rule-based matching compares via matchKey.

import * as AWS from "@alchemy.run/aws";
const schema = yield* AWS.EntityResolution.SchemaMapping("Customers", {
mappedInputFields: [
{ fieldName: "id", type: "UNIQUE_ID" },
{ fieldName: "email", type: "EMAIL_ADDRESS", matchKey: "email" },
{ fieldName: "name", type: "NAME", matchKey: "name" },
],
});
const workflow = yield* AWS.EntityResolution.MatchingWorkflow("Dedupe", {
inputSourceConfig: [
{ inputSourceARN: table.tableArn, schemaName: schema.schemaName },
],
// ...
});

SchemaMapping: Looking up an existing schema mapping

Section titled “SchemaMapping: Looking up an existing schema mapping”

SchemaMapping.lookup references a schema mapping Alchemy doesn’t manage (created in the console or by another stack), found by schemaName. It is read during plan/deploy and never created, updated or deleted.

const existing = AWS.EntityResolution.SchemaMapping.lookup({ schemaName: "my-schema-mapping" });

Source: packages/aws/src/EntityResolution/StartIdMappingJob.ts

Runtime binding for entityresolution:StartIdMappingJob.

Starts an ID mapping job run of the bound workflow — a batch process over the workflow’s full input that takes many minutes. Provide the implementation with Effect.provide(AWS.EntityResolution.StartIdMappingJobHttp).

StartIdMappingJob: Running ID Mapping Jobs

Section titled “StartIdMappingJob: Running ID Mapping Jobs”
// init — bind the operation to the workflow
const startIdMappingJob = yield* AWS.EntityResolution.StartIdMappingJob(workflow);
// runtime
const { jobId } = yield* startIdMappingJob({});

Source: packages/aws/src/EntityResolution/StartMatchingJob.ts

Runtime binding for entityresolution:StartMatchingJob.

Starts a matching job run of the bound workflow — a batch process over the workflow’s full input that takes many minutes. Provide the implementation with Effect.provide(AWS.EntityResolution.StartMatchingJobHttp).

// init — bind the operation to the workflow
const startMatchingJob = yield* AWS.EntityResolution.StartMatchingJob(workflow);
// runtime
const { jobId } = yield* startMatchingJob({});