Skip to content

Add basic scheduler#732

Closed
erpel wants to merge 2 commits intoterraform-aws-modules:masterfrom
erpel:add_schedule
Closed

Add basic scheduler#732
erpel wants to merge 2 commits intoterraform-aws-modules:masterfrom
erpel:add_schedule

Conversation

@erpel
Copy link

@erpel erpel commented Jan 29, 2026

Description

This adds the ability to run a lambda on a schedule, like a cron job. It's very basic at the moment. I'd like to use it as a starting point to even find out if something like this would be considered for the module or if you'd consider it out of scope and inappropriate.

For now I've kept the changes to one file. If this kind of feature is generally acceptable for the module I'll integrate it properly of course.

I'd be happy about any input on making the scheduler more configurable. I could imagine exposing target and retry configuration as variables and offer control over adding a dead letter queue.

This works with a simple lambda in a test setup already. Please let me know if this is worth pursuing and bringing to a level required for inclusion in the module.

Motivation and Context

I (and I assume many others) run lambda functions based on schedules as a cron like tool on AWS. Creating the function is very convenient with this module and I often found myself wanting to just "Give it a cron expression and be done".

The setup needed to run a lambda based on a schedule is repetitive and lends itself well to code reuse, at least for simple cases.

Breaking Changes

No breaking change should be necessary, this only adds at least one new variable and additional resources from providers that are already required for basic functionality.

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

@antonbabenko
Copy link
Member

This violates the whole point of the resource module, which should just wrap resources within one service. Combine it with the eventbridge module for scheduling, but it can't be in this module.

@erpel
Copy link
Author

erpel commented Jan 29, 2026

Thanks for clarifying, I get it.

@github-actions
Copy link

github-actions bot commented Mar 1, 2026

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants