Skip to main content

Module shared

Module shared 

Source
Expand description

Primitives shared across the Amazon Comprehend handlers: ARN synthesis, deterministic id derivation, and timestamps. Kept in one place so the create / describe paths cannot diverge on wire format.

Functions§

hash_str
FNV-1a hash for deterministic synthesis of ids from a seed so a given resource’s derived value is stable across reads and restarts.
hex32
A stable, AWS-shaped 32-hex-character id (as used for job ids) derived from a seed, or a fresh random one when seed is empty.
now_epoch
Current time as awsJson1_1 epoch-seconds (a floating-point number). The Comprehend Timestamp shape carries no @timestampFormat, so awsJson1_1’s default epoch-seconds applies.
parse_resource_arn
Split a Comprehend ARN into (resource_type, tail). arn:aws:comprehend:{region}:{account}:{type}/{tail} -> (type, tail). tail keeps any further /-separated segments (version, dataset, …).
resource_arn
Amazon Comprehend resource ARN, arn:aws:comprehend:{region}:{account}:{resource_type}/{tail}.