Skip to content

Commit

Permalink
update cron job and update lambda environment to node 20.
Browse files Browse the repository at this point in the history
  • Loading branch information
aasmal97 committed Jan 7, 2025
1 parent 2758a46 commit e8f8e44
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { LambdaFunction } from "aws-cdk-lib/aws-events-targets";
import * as lambda from "aws-cdk-lib/aws-lambda";

import path = require("path");
import { Rule, Schedule } from "aws-cdk-lib/aws-events";
export const createSkillCronJob = ({
stack,
skillsTableInfo,
Expand Down Expand Up @@ -51,12 +52,10 @@ export const createSkillCronJob = ({
const skillsCronJobTarget = new LambdaFunction(skillsCronLambda, {
retryAttempts: 1,
});
const skillsCronJobEvent = createCronEvent({
stack: stack,
id: "skillsCronJobEvent",
hours: 72,
//run every three days
const skillsCronJobEvent = new Rule(stack, "skillsCronJobEvent", {
schedule: Schedule.rate(cdk.Duration.days(3)),
targets: [skillsCronJobTarget],
});

return skillsCronJobEvent;
};
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const createGoogleDrivePostStateMachine = ({
const googleDrivePostName = "googleDrivePostStepFunction";
const googleDrivePostStepFunctionLambda = stack
? new lambda.Function(stack, `${googleDrivePostName}Lambda`, {
runtime: lambda.Runtime.NODEJS_16_X,
runtime: lambda.Runtime.NODEJS_20_X,
code: lambda.Code.fromAsset(location.absolute),
handler: "index.handler",
timeout: Duration.minutes(14),
Expand Down
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"@octokit/webhooks-types": "=6.10.0",
"@types/aws-lambda": "=8.10.110",
"@types/babel__core": "=7.20.0",
"@types/fs-extra": "=11.0.1",
"@types/html-to-text": "=9.0.0",
"@types/jest": "=29.2.5",
"@types/jsonwebtoken": "=9.0.1",
Expand All @@ -36,7 +35,6 @@
"dependencies": {
"@aws-sdk/client-dynamodb": "=3.259.0",
"@aws-sdk/client-s3": "=3.259.0",
"@aws-sdk/client-ses": "=3.315.0",
"@aws-sdk/client-sfn": "=3.301.0",
"@aws-sdk/util-dynamodb": "=3.262.0",
"aws-cdk-lib": "=2.115.0",
Expand All @@ -46,7 +44,6 @@
"date-fns": "=2.29.3",
"dotenv": "=16.0.3",
"email-validator": "=2.0.4",
"fs-extra": "=11.1.1",
"googleapis": "=111.0.0",
"html-to-text": "=9.0.4",
"jimp": "=0.22.7",
Expand Down
2 changes: 1 addition & 1 deletion utils/createResources/createApiTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export const createLambdaFuncs = (e: cdk.Stack, restAPIMap: RestAPIType) => {
for (let [key, value] of funcLocationArr) {
const buildPath = value.location;
const newFunc = new lambda.Function(e, key, {
runtime: lambda.Runtime.NODEJS_16_X,
runtime: lambda.Runtime.NODEJS_20_X,
handler: `index.handler`,
code: lambda.Code.fromAsset(buildPath.absolute),
role: value.role,
Expand Down

0 comments on commit e8f8e44

Please sign in to comment.