New serverless pattern - eventbridge-scheduler-ai-agent-trigger#2992
Conversation
ellisms
left a comment
There was a problem hiding this comment.
Hi @ras-al-jil - thank you for your submission. Requesting a few changes.
|
|
||
| ## Testing | ||
|
|
||
| 1. Invoke the orchestrator Lambda manually: |
There was a problem hiding this comment.
| 1. Invoke the orchestrator Lambda manually: | |
| 1. Replace `<prefix>` with the prefix chosen during deployment and invoke the orchestrator Lambda function manually: |
| @@ -0,0 +1,89 @@ | |||
| # Amazon EventBridge Scheduler to Amazon Bedrock AI Agent | |||
|
|
|||
| This pattern demonstrates how to trigger an Amazon Bedrock AI Agent on a recurring schedule using Amazon EventBridge Scheduler. An orchestrator Lambda function, invoked by the scheduler, sends a task payload to the Bedrock Agent, which processes the input, generates an execution summary, and persists the result to a DynamoDB table via an action group Lambda. | |||
There was a problem hiding this comment.
| This pattern demonstrates how to trigger an Amazon Bedrock AI Agent on a recurring schedule using Amazon EventBridge Scheduler. An orchestrator Lambda function, invoked by the scheduler, sends a task payload to the Bedrock Agent, which processes the input, generates an execution summary, and persists the result to a DynamoDB table via an action group Lambda. | |
| This pattern demonstrates how to trigger an Amazon Bedrock AI Agent on a recurring schedule using Amazon EventBridge Scheduler. An orchestrator AWS Lambda function, invoked by the scheduler, sends a task payload to the Bedrock Agent, which processes the input, generates an execution summary, and persists the result to a Amazon DynamoDB table via an action group Lambda. |
| retention_in_days = var.log_retention_days | ||
| } | ||
|
|
||
| resource "aws_lambda_function" "action_group" { |
There was a problem hiding this comment.
I think there is value in not pre-zipping the Lambda code and having TF do this via the archive_file resource type. Recommend including the raw python code and adding the archive_file resource as input to this resource.
| retention_in_days = var.log_retention_days | ||
| } | ||
|
|
||
| resource "aws_lambda_function" "orchestrator" { |
There was a problem hiding this comment.
I think there is value in not pre-zipping the Lambda code and having TF do this via the archive_file resource type. Recommend including the raw python code and adding the archive_file resource as input to this resource.
|
|
||
| 1. Destroy the stack: | ||
| ``` | ||
| terraform destroy -auto-approve |
There was a problem hiding this comment.
| terraform destroy -auto-approve | |
| terraform destroy --auto-approve |
Issue #2993, if available:
Description of changes:
This pattern demonstrates how to trigger an Amazon Bedrock AI Agent on a recurring schedule using Amazon EventBridge Scheduler. An orchestrator AWS Lambda function, invoked by the scheduler, sends a task payload to the Bedrock Agent, which processes the input, generates an execution summary, and persists the result to a DynamoDB table via an action group Lambda. The pattern includes retry logic, a dead-letter queue for failed invocations, and least-privilege IAM policies scoped to the agent alias ARN.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.