-
Notifications
You must be signed in to change notification settings - Fork 1k
Expand file tree
/
Copy pathexample-pattern.json
More file actions
86 lines (86 loc) · 2.99 KB
/
example-pattern.json
File metadata and controls
86 lines (86 loc) · 2.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{
"title": "Lambda Durable Functions with Human-in-the-Loop",
"description": "Demonstrates Lambda durable functions with human approval workflow using Python 3.13, DynamoDB, and SNS",
"language": "Python",
"level": "300",
"framework": "SAM",
"introBox": {
"headline": "How it works",
"text": [
"This pattern demonstrates how to pause Lambda execution, wait for human approval, and resume using the Lambda durable functions SDK.",
"The Workflow Lambda creates an approval request in DynamoDB and polls for decisions using durable waits (no compute charges during waits).",
"An SNS notification is sent to approvers, who can submit their decision via the Approval API Lambda function.",
"The Workflow Lambda detects the decision during polling and resumes execution with the approval result.",
"The pattern includes timeout handling, status tracking, and a complete audit trail of all approval decisions."
]
},
"gitHub": {
"template": {
"repoURL": "https://github.com/aws-samples/serverless-patterns/tree/main/lambda-durable-hitl-python-sam",
"templateURL": "serverless-patterns/lambda-durable-hitl-python-sam",
"projectFolder": "lambda-durable-hitl-python-sam",
"templateFile": "template.yaml"
}
},
"resources": {
"bullets": [
{
"text": "Lambda Durable Functions Documentation",
"link": "https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html"
},
{
"text": "AWS SAM Documentation",
"link": "https://docs.aws.amazon.com/serverless-application-model/"
},
{
"text": "DynamoDB Best Practices",
"link": "https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/best-practices.html"
},
{
"text": "Amazon SNS Documentation",
"link": "https://docs.aws.amazon.com/sns/"
}
]
},
"deploy": {
"text": [
"sam build",
"sam deploy --guided"
]
},
"testing": {
"text": [
"See the README in the GitHub repo for detailed testing instructions.",
"Test the approval workflow using AWS CLI:",
"1. Publish Lambda version: aws lambda publish-version --function-name <WorkflowFunction>",
"2. Invoke workflow: aws lambda invoke --function-name <WorkflowFunction>:<version> --invocation-type Event --payload '{...}' response.json",
"3. List approvals: aws dynamodb scan --table-name <ApprovalsTable>",
"4. Submit decision: aws lambda invoke --function-name <ApprovalApiFunction> --payload '{\"action\":\"decide\",...}' response.json"
]
},
"cleanup": {
"text": [
"Delete the stack: sam delete"
]
},
"authors": [
{
"name": "Mian Tariq",
"bio": "Cloud Solutions Architect"
}
],
"patternArch": {
"icon1": {
"name": "lambda",
"label": "Lambda Durable Functions"
},
"icon2": {
"name": "dynamodb",
"label": "Amazon DynamoDB"
},
"icon3": {
"name": "sns",
"label": "Amazon SNS"
}
}
}