AWS Lambda · Arazzo Workflow
AWS Lambda Tear a Function Down in Dependency Order
Version 1.0.0
Detach the event sources and the public URL that outlive a function, then delete the function and all its versions and aliases.
Provider
Workflows
function-teardown
Remove a function's event source mapping and URL, then delete the function.
Confirms the function, enumerates the event source mappings that would otherwise be orphaned, deletes the first of them and the function URL, and finally deletes the function together with its versions and aliases. Run once per attached mapping when a function consumes from more than one source.
1
confirmFunction
getFunction
Confirm the function exists and capture its ARN before anything is deleted, so a mistyped name fails before it can detach resources belonging to some other function.
2
findEventSourceMappings
listEventSourceMappings
List the event source mappings pointed at this function. These are independent resources that survive the function's deletion, so they must be enumerated before it disappears and their UUIDs become hard to recover.
3
deleteFirstMapping
deleteEventSourceMapping
Delete the mapping so Lambda stops polling the event source. Deletion is asynchronous and returns 202 while the mapping drains in-flight records.
4
deleteFunctionUrl
deleteFunctionUrlConfig
Remove the public HTTPS endpoint. A function with no URL configured returns 404 here, which is a successful outcome for a teardown, so the flow continues to the deletion either way.
5
deleteTheFunction
deleteFunction
Delete the function itself. Qualifier is deliberately omitted so that every version and alias is removed rather than a single version, leaving nothing behind.