Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lambda-durable-human-approval-sam/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This pattern demonstrates a human-in-the-loop approval workflow using AWS Lambda

**Important:** Please check the [AWS documentation](https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html) for regions currently supported by AWS Lambda durable functions.

Learn more about this pattern at Serverless Land Patterns: https://serverlessland.com/patterns/lambda-durable-hitl-approval-sam
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: It's wrong url

Learn more about this pattern at Serverless Land Patterns: https://serverlessland.com/patterns/lambda-durable-human-approval-sam

## Architecture

Expand Down Expand Up @@ -44,7 +44,7 @@ The pattern uses Lambda durable functions to implement a cost-effective approval

1. Navigate to the pattern directory:
```bash
cd lambda-durable-hitl-approval-sam
cd lambda-durable-human-approval-sam
```

2. Build the SAM application:
Expand Down Expand Up @@ -197,14 +197,14 @@ sam deploy --parameter-overrides ApproverEmail=new-email@example.com

Monitor the durable function:
```bash
aws logs tail /aws/lambda/lambda-durable-hitl-approval-ApprovalFunction-XXXXX \
aws logs tail /aws/lambda/lambda-durable-human-approval-ApprovalFunction \
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: Update CloudWatch Logs log group name because I set FunctionName in SAM template

--region us-east-2 \
--follow
```

Monitor the callback handler:
```bash
aws logs tail /aws/lambda/lambda-durable-hitl-approv-CallbackHandlerFunction-XXXXX \
aws logs tail /aws/lambda/lambda-durable-human-approval-CallbackHandlerFunction \
--region us-east-2 \
--follow
```
Expand All @@ -214,7 +214,7 @@ aws logs tail /aws/lambda/lambda-durable-hitl-approv-CallbackHandlerFunction-XXX
## Cleanup

```bash
sam delete --stack-name lambda-durable-hitl-approval --region us-east-2
sam delete --stack-name lambda-durable-human-approval --region us-east-2
```


Expand Down
4 changes: 3 additions & 1 deletion lambda-durable-human-approval-sam/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Resources:
CallbackHandlerFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: !Sub '${AWS::StackName}-CallbackHandlerFunction'
CodeUri: src/
Handler: callback_handler.lambda_handler
Runtime: python3.14
Expand All @@ -56,6 +57,7 @@ Resources:
ApprovalFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: !Sub '${AWS::StackName}-ApprovalFunction'
CodeUri: src/
Handler: lambda_function.lambda_handler
Runtime: python3.14
Expand Down Expand Up @@ -139,7 +141,7 @@ Resources:
x-amazon-apigateway-integration:
type: aws
httpMethod: POST
uri: !Sub 'arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${ApprovalFunction.Arn}:live/invocations'
uri: !Sub 'arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${AWS::StackName}-ApprovalFunction:live/invocations'
requestParameters:
integration.request.header.X-Amz-Invocation-Type: "'Event'"
responses:
Expand Down