New serverless pattern - lambda-df-slack#3111
Open
ras-al-jil wants to merge 1 commit into
Open
Conversation
marcojahn
reviewed
Jun 14, 2026
marcojahn
left a comment
Contributor
There was a problem hiding this comment.
Hello @ras-al-jil, thank you for your contribution.
Your PR as has 2167 files, especially the .src folder contains a lot of library files, can you please cleanup/fix to a proper setup.
Also on a high level I've found the following things, please review and fix before this PR can be merged
- Move the Slack bot token and signing secret out of plaintext Lambda environment variables into AWS Secrets Manager or SSM Parameter Store (SecureString).
- Stop passing the Slack secrets through Terraform
null_resourcetriggers — they get persisted to state in plaintext. - Scope the
bedrock-agentcore:InvokeAgentRuntimepermission to the specific runtime ARN instead ofResource: "*". - Scope the AgentCore runtime role's
bedrock:InvokeModelto the Claude models/inference profiles and the ECR pull actions to the repository ARN (keep onlyecr:GetAuthorizationTokenon*). - Scope the
lambda:SendDurableExecutionCallback*actions to the orchestrator function ARN instead ofResource: "*". - Add explicit server-side encryption to the DynamoDB table.
- Remove vendored dependencies that leaked into the source tree (
six.py,bin/jp.py) and add a.gitignore(Python caches, Terraform state, generated zip/txt artifacts). - Fix the broken architecture diagram reference in the README (the image markdown is malformed).
- Align the container prerequisite with the deployment scripts — the README says "Docker or Finch" but the scripts call
finchdirectly. - Resolve the Bedrock model mismatch — the README references Claude 3.5 Sonnet v2 while the code uses
claude-sonnet-4-6. - Document the minimum AWS CLI version required for durable functions in the prerequisites.
- Add a dependency installation/bundling step — the durable execution SDK is never installed into the package, so the function will fail to import it at runtime (this is the most critical issue; see next point).
- Bundle the durable execution SDK into the Lambda deployment package (or attach it as a layer); the current
archive_filezips the source only. - Read the Bedrock model ID from the
BEDROCK_MODEL_IDenvironment variable instead of hardcoding it. - Remove the hardcoded/inconsistent region fallbacks and rely on the runtime-provided region.
- Replace
print()with structured logging in the non-durable modules. - Don't silently swallow callback-send failures — log/raise so a failed callback doesn't leave the conversation stuck.
- Fix AWS service naming throughout the README and metadata: use "Lambda durable functions" (lowercase — it's an AWS Lambda feature, not the Azure product), and full official names on first reference (Amazon Bedrock AgentCore, Amazon DynamoDB, Amazon API Gateway).
- Replace the in-memory Slack event deduplication with a durable store (e.g., DynamoDB conditional write + TTL); the current in-memory dict doesn't hold across concurrent Lambda instances.
- Move the non-deterministic
execution_idtimestamp generation inside acontext.step()— generating it outside a step breaks the replay model. - Make the
wait_for_callbacksubmitter writes deterministic — the wall-clock timestamps used to pick the active callback can diverge on replay.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
*Issue #3112
Description of changes:
A Slack chatbot using AWS Lambda Durable Functions for stateful, multi-turn conversations with human-in-the-loop interactions, generating travel itineraries via Amazon Bedrock through AgentCore.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.