Skip to content

StartDocumentClassificationJob

Source: src/AWS/Comprehend/StartDocumentClassificationJob.ts

Runtime binding for comprehend:StartDocumentClassificationJob — start an asynchronous document classification job over a collection of documents in S3.

The binding is constructed with the data-access role (the IAM role Amazon Comprehend assumes to read the input documents and write results; its trust policy must allow comprehend.amazonaws.com). The role’s ARN is injected as DataAccessRoleArn on every runtime request and the host is granted iam:PassRole on it alongside the comprehend:StartDocumentClassificationJob action (which has no resource-level IAM). Track the job with DescribeDocumentClassificationJob.

// deploy time — bind the Comprehend data-access role
const startDocumentClassificationJob = yield* AWS.Comprehend.StartDocumentClassificationJob(dataAccessRole);
// runtime
const job = yield* startDocumentClassificationJob({
DocumentClassifierArn: classifierArn,
InputDataConfig: { S3Uri: "s3://my-bucket/input/", InputFormat: "ONE_DOC_PER_LINE" },
OutputDataConfig: { S3Uri: "s3://my-bucket/output/" },
});
// job.JobId, job.JobStatus === "SUBMITTED"