Skip to main content

cdk-library-one-time-event

build

An AWS CDK Construct library to create one time event schedules.

Features

  • Create two types of event schedules easily:

    • On Deployment: An one time event schedule for directly after deployment. Defaults to 10mins after.
    • At: A one time even schedule for any future Date()

API Doc

See API

Examples

Typescript - run after deploy, offset 15mins

import * as cdk from '@aws-cdk/core';
import * as lambda from '@aws-cdk/aws-lambda';
import * as oneTimeEvents from '@renovosolutions/cdk-library-one-time-event';

export class CdkExampleLambdaStack extends cdk.Stack {
  constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);

    const handler = new lambda.Function(this, 'handler', {
      runtime: lambda.Runtime.PYTHON_3_8,
      code: lambda.Code.fromAsset(functionDir + '/function.zip'),
      handler: 'index.handler',
    });

    new events.Rule(this, 'triggerImmediate', {
      schedule: new oneTimeEvents.OnDeploy(this, 'schedule', {
        offsetMinutes: 15
      }).schedule,
      targets: [new targets.LambdaFunction(this.handler)],
    });

Typescript - run in 24 hours

import * as cdk from '@aws-cdk/core';
import * as lambda from '@aws-cdk/aws-lambda';
import * as oneTimeEvents from '@renovosolutions/cdk-library-one-time-event';

export class CdkExampleLambdaStack extends cdk.Stack {
  constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);

    const handler = new lambda.Function(this, 'handler', {
      runtime: lambda.Runtime.PYTHON_3_8,
      code: lambda.Code.fromAsset(functionDir + '/function.zip'),
      handler: 'index.handler',
    });

    var tomorrow = new Date()
    tomorrow.setDate(tomorrow.getDate() + 1)

    new events.Rule(this, 'triggerImmediate', {
      schedule: new oneTimeEvents.At(this, 'schedule', {
        date: tomorrow
      }).schedule,
      targets: [new targets.LambdaFunction(this.handler)],
    });

Metadata

Release files for renovosolutions.aws-cdk-one-time-event 2.1.126

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

Source distribution (sdist)

Source distribution for renovosolutions.aws-cdk-one-time-event 2.1.126
File Size Uploaded Provenance Actions
renovosolutions_aws_cdk_one_time_event-2.1.126.tar.gz 28.8 kB Without provenance Details for renovosolutions_aws_cdk_one_time_event-2.1.126.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for renovosolutions.aws-cdk-one-time-event 2.1.126
File Interpreter ABI Platform Actions
renovosolutions.aws_cdk_one_time_event-2.1.126-py3-none-any.whl Python 3 none any Details for renovosolutions.aws_cdk_one_time_event-2.1.126-py3-none-any.whl

Total release size: 58.2 kB

Release files / renovosolutions_aws_cdk_one_time_event-2.1.126.tar.gz

Download URL renovosolutions_aws_cdk_one_time_event-2.1.126.tar.gz
Size 28.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3b58e142c5276546f3e91aceb1255849e55fab861cafd0d4fed0acfd6c618210
BLAKE2b-256 checksum
How to use checksums
8e8f3ba83a10698596cefc4b0d50c0fe9f76fa6aad347125382eb625bf1ed311
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Release files / renovosolutions.aws_cdk_one_time_event-2.1.126-py3-none-any.whl

Download URL renovosolutions.aws_cdk_one_time_event-2.1.126-py3-none-any.whl
Size 29.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e9b043297ceb1dc4f1bde91240c94ad9eb055989f30eb5668bee9911baed379
BLAKE2b-256 checksum
How to use checksums
9d74e61dfbbbcc2a36d406d4201e56d5e045559954ab1fa00ae4dd0f613e21fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Security for renovosolutions.aws-cdk-one-time-event 2.1.126

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

2.1.126 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