Skip to main content

PAWS Lambda Time Trigger

This package makes it easy to trigger Lambda functions more often than once a minute - the default service to trigger Lambdas periodically, EventBridge rules, will only allow to define schedules down to a resolution of 1 minute.

Using the PAWS Lambda Time Trigger package, you can define schedules with a resolution down to 1 second.

The PAWS Lambda Time Trigger package will, on top of any resources you create, including the Lambda function to be triggered on a schedule, create:

  • An AWS Step Function running the sub-minute schedule you defined by waiting between invokes of your target Lambda
  • An EventBrige rule triggering the AWS step function based on the rest of the schedule you define as a CRON expression

If you specify a CRON schedule without the second field being set, or with it being set to 0, the TimeTrigger will just create a plain EventBridge rule with that schedule triggering your Lambda directly, without the AWS Step Function in between.

Basic usage

TypeScript / JavaScript

const timeTrigger = new TimeTrigger(this, 'time-trigger', {
  schedule: {
    cron: {
      second: '0-19/5,20-59/20', // Triggers at seconds 0, 5, 10, 15, 20 and 40 of every minute...
      hour: '9-17' // ... of every hour between 9 and 17 each day
    },
  },
});

yourLambdaFunction.addEventSource(timeTrigger);

Known limitations

Lambda execution time

As of now, the AWS Step Function does not take the time required to execute the scheduled Lambda into account. In other words: if you schedule your Lambda with a TimeTrigger to be executed every 10 seconds (second:'*/10'), but your scheduled Lambda takes 1 second to run, you will see the following behavior:

  • The AWS Step function will be triggered every minute (unless you specified another schedule)

  • The AWS Step function will run your Lambda on...

    • Second 0, taking 1 second to complete, then waiting 10 seconds
    • Second 11, taking 1 second to complete, then waiting 10 seconds
    • Second 22, taking 1 second to complete, then waiting 10 seconds
    • Second 33, taking 1 second to complete, then waiting 10 seconds
    • Second 44, taking 1 second to complete, then waiting 10 seconds
    • Second 55, taking 1 second to complete, then finishing

Metadata

Release files for paws.lambda-time-trigger 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for paws.lambda-time-trigger 1.0.0
File Size Uploaded Provenance Actions
paws.lambda-time-trigger-1.0.0.tar.gz 872.1 kB Without provenance Details for paws.lambda-time-trigger-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for paws.lambda-time-trigger 1.0.0
File Interpreter ABI Platform Actions
paws.lambda_time_trigger-1.0.0-py3-none-any.whl Python 3 none any Details for paws.lambda_time_trigger-1.0.0-py3-none-any.whl

Total release size: 1.7 MB

Release files / paws.lambda-time-trigger-1.0.0.tar.gz

Download URL paws.lambda-time-trigger-1.0.0.tar.gz
Size 872.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0e4ca172ae64ec0fe6aa4c02bc68f95e4dda51bbe580eca36b6b1a7ec5c4e515
BLAKE2b-256 checksum
How to use checksums
40b4dfb0cb653ade7383f59d664b22565f4b60cdffbbeab126252047448d277e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.3

Release files / paws.lambda_time_trigger-1.0.0-py3-none-any.whl

Download URL paws.lambda_time_trigger-1.0.0-py3-none-any.whl
Size 870.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b52ff4758352818c23333c0c3f4a4bc9726cade67a7ddc71d07c2f74874bb51
BLAKE2b-256 checksum
How to use checksums
b9c7d611787e94836800fc99b20493180a626d63fcc22a13e17884278acc1f62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.3

Security for paws.lambda-time-trigger 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page