Skip to content

New serverless pattern - eventbridge-scheduler-ai-agent-trigger#2992

Open
ras-al-jil wants to merge 1 commit intoaws-samples:mainfrom
ras-al-jil:ras-al-jil-feature-eventbridge-scheduler-ai-agent-trigger
Open

New serverless pattern - eventbridge-scheduler-ai-agent-trigger#2992
ras-al-jil wants to merge 1 commit intoaws-samples:mainfrom
ras-al-jil:ras-al-jil-feature-eventbridge-scheduler-ai-agent-trigger

Conversation

@ras-al-jil
Copy link
Copy Markdown

@ras-al-jil ras-al-jil commented Mar 13, 2026

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.

Copy link
Copy Markdown
Contributor

@ellisms ellisms left a comment

Choose a reason for hiding this comment

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

Hi @ras-al-jil - thank you for your submission. Requesting a few changes.


## Testing

1. Invoke the orchestrator Lambda manually:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
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" {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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" {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
terraform destroy -auto-approve
terraform destroy --auto-approve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants