EventBridge scheduler-triggered Function
This guide describes a scheduled AWS architecture where EventBridge scheduler triggers a Lambda function at defined intervals to start a deployment workflow.
The setup leverages BYM’s Terraform modules setup terraform-byks-module which provision the necessary IAM roles and permissions and apply the standard default configuration.
source directory structure
├──application-name/
├── byks_application_name.tf
lambda_functions {
schedules {}
}
└── locals.tf
The Lambda function and the scheduler schedule
Add the following code to byks_kattehotell.tf file to configure a Lambda function and an EventBridge schedule.
The required environment variables for the Lambda function can be provided in the
locals.tf file inside kattehotell_refresh_user_role_environment_variables section.
Result:
The Lambda function kattehotell-refresh-user-roles is triggered once every hour to start a job.