Manage Executions¶
Use the AWS CLI to inspect, stop, update, and clean up durable functions and their executions.
List executions¶
Get execution details¶
Get execution history¶
View the checkpoint history for an execution:
Stop an execution¶
Update function code¶
After updating your code, publish a new version and point your alias to it.
aws lambda update-function-code \
--function-name my-durable-function \
--zip-file fileb://function.zip
aws lambda wait function-updated \
--function-name my-durable-function
aws lambda publish-version \
--function-name my-durable-function
aws lambda update-alias \
--function-name my-durable-function \
--name prod \
--function-version <new-version>
aws lambda update-function-code \
--function-name my-durable-function \
--image-uri 123456789012.dkr.ecr.us-east-1.amazonaws.com/my-durable-function:latest
aws lambda wait function-updated \
--function-name my-durable-function
aws lambda publish-version \
--function-name my-durable-function
aws lambda update-alias \
--function-name my-durable-function \
--name prod \
--function-version <new-version>
Running executions will continue to use the version they started with. New invocations use the updated alias.
If you're still actively developing and you don't want to publish a new version each
time you update, you could use LATEST$ just during development, but please be very
aware that executions might not replay correctly (or even fail) if the underlying code
changes during running executions. Always use numbered versions or aliases in
production.
View logs¶
Delete durable functions¶
aws lambda delete-function --function-name my-durable-function
aws iam detach-role-policy \
--role-name durable-function-role \
--policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicDurableExecutionRolePolicy
aws iam delete-role --role-name durable-function-role
If you deployed as a container image, also delete the image from ECR:
Replace latest with the tag you pushed if you used a different tag. To delete multiple
tags at once, specify each with a separate imageTag= argument: