Documentation
¶
Overview ¶
Command copycompletion is the deployable Lambda entrypoint that closes the loop on a dataset copy. A copy runs for hours or days, so no command waits on it; the copy service announces its terminal state on the event bus, an EventBridge rule delivers that here, and the copy record is moved to staged or failed.
It is wiring only: it reads configuration from the environment, constructs clients from the Lambda execution role, and delegates to dataset.CopyCompletionHandler. Matching an event to a copy, deciding what to record, and deciding what is worth retrying all live there, where they are testable without a deployment.
It is handed a copy ledger and nothing else. Recording what a transfer delivered has no business reaching a grant: who may read the data is decided by the commands, from a record this entrypoint cannot see and would have no reason to write.
The handler returns an error only for a failure another attempt could get past, so a non-nil error here is a genuine invitation to retry. An event that names a copy nothing is waiting on, or a copy that has already reported, is not a failure and is logged as nothing to do.
Environment variables (read once at cold start):
SHARE_RECORDS_TABLE_NAME (required) DynamoDB table holding the ledger, shared with
the htsget mechanism.
The execution role needs write access to that table, permission to describe executions of the copy state machine, and read access to the copy service's working bucket -- where the copy retains its summary of what it moved. It deliberately needs no access to any dataset's own bucket or key.