How to use @aws-cdk/aws-lambda-nodejs - 9 common examples

To help you get started, we’ve selected a few @aws-cdk/aws-lambda-nodejs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github deepalert / deepalert / lib / deepalert-stack.ts View on Github external
this.attributeQueue = new sqs.Queue(this, "attributeQueue", {
      visibilityTimeout: attributeQueueTimeout,
    });

    // ----------------------------------------------------------------
    // Lambda Functions
    const baseEnvVars = {
      TASK_TOPIC: this.taskTopic.topicArn,
      REPORT_TOPIC: this.reportTopic.topicArn,
      CACHE_TABLE: this.cacheTable.tableName,
    };
    const nodeModulesLayer = new lambda.LayerVersion(this, "NodeModulesLayer", {
      code: lambda.AssetCode.fromAsset("????"),
      compatibleRuntimes: [lambda.Runtime.NODEJS_10_X],
    });
    this.recvAlert = new NodejsFunction(this, "recvAlert", {
      entry: path.join(__dirname, "lambda/recvAlert.js"),
      handler: "main",
      timeout: alertQueueTimeout,
      role: lambdaRole,
      events: [new SqsEventSource(this.alertQueue)],
      environment: Object.assign(baseEnvVars, {
        INSPECTOR_MACHINE: "",
        REVIEW_MACHINE: "",
      }),
    });

    this.submitContent = new NodejsFunction(this, "submitContent", {
      entry: path.join(__dirname, "lambda/submitContent.js"),
      handler: "main",
      role: lambdaRole,
      events: [new SqsEventSource(this.alertQueue)],
github deepalert / deepalert / lib / deepalert-stack.ts View on Github external
handler: "main",
      role: lambdaRole,
    });
    this.publishReport = new NodejsFunction(this, "publishReport", {
      entry: path.join(__dirname, "lambda/publishReport.js"),
      handler: "main",
      role: lambdaRole,
      environment: baseEnvVars,
    });
    this.stepFunctionError = new NodejsFunction(this, "stepFunctionError", {
      entry: path.join(__dirname, "lambda/stepFunctionError.js"),
      handler: "main",
      role: lambdaRole,
      environment: baseEnvVars,
    });
    this.lambdaError = new NodejsFunction(this, "lambdaError", {
      entry: path.join(__dirname, "lambda/lambdaError.js"),
      handler: "main",
      role: lambdaRole,
      environment: baseEnvVars,
    });

    this.inspectionMachine = buildInspectionMachine(
      this,
      this.dispatchInspection,
      this.stepFunctionError,
      props.inspectDelay,
      sfnRole
    );

    this.inspectionMachine = buildReviewMachine(
      this,
github deepalert / deepalert / lib / deepalert-stack.ts View on Github external
handler: "main",
      role: lambdaRole,
      events: [new SqsEventSource(this.alertQueue)],
      environment: baseEnvVars,
    });

    this.feedbackAttribute = new NodejsFunction(this, "feedbackAttribute", {
      entry: path.join(__dirname, "lambda/feedbackAttribute.js"),
      handler: "main",
      timeout: attributeQueueTimeout,
      role: lambdaRole,
      events: [new SqsEventSource(this.attributeQueue)],
      environment: baseEnvVars,
    });

    this.dispatchInspection = new NodejsFunction(this, "dispatchInspection", {
      entry: path.join(__dirname, "lambda/dispatchInspection.js"),
      handler: "main",
      role: lambdaRole,
      environment: baseEnvVars,
    });
    this.compileReport = new NodejsFunction(this, "compileReport", {
      entry: path.join(__dirname, "lambda/compileReport.js"),
      handler: "main",
      role: lambdaRole,
      environment: baseEnvVars,
    });
    this.dummyReviewer = new NodejsFunction(this, "dummyReviewer", {
      entry: path.join(__dirname, "lambda/dummyReviewer.js"),
      handler: "main",
      role: lambdaRole,
    });
github deepalert / deepalert / lib / deepalert-stack.ts View on Github external
handler: "main",
      role: lambdaRole,
      environment: baseEnvVars,
    });
    this.dummyReviewer = new NodejsFunction(this, "dummyReviewer", {
      entry: path.join(__dirname, "lambda/dummyReviewer.js"),
      handler: "main",
      role: lambdaRole,
    });
    this.publishReport = new NodejsFunction(this, "publishReport", {
      entry: path.join(__dirname, "lambda/publishReport.js"),
      handler: "main",
      role: lambdaRole,
      environment: baseEnvVars,
    });
    this.stepFunctionError = new NodejsFunction(this, "stepFunctionError", {
      entry: path.join(__dirname, "lambda/stepFunctionError.js"),
      handler: "main",
      role: lambdaRole,
      environment: baseEnvVars,
    });
    this.lambdaError = new NodejsFunction(this, "lambdaError", {
      entry: path.join(__dirname, "lambda/lambdaError.js"),
      handler: "main",
      role: lambdaRole,
      environment: baseEnvVars,
    });

    this.inspectionMachine = buildInspectionMachine(
      this,
      this.dispatchInspection,
      this.stepFunctionError,
github deepalert / deepalert / lib / deepalert-stack.ts View on Github external
this.feedbackAttribute = new NodejsFunction(this, "feedbackAttribute", {
      entry: path.join(__dirname, "lambda/feedbackAttribute.js"),
      handler: "main",
      timeout: attributeQueueTimeout,
      role: lambdaRole,
      events: [new SqsEventSource(this.attributeQueue)],
      environment: baseEnvVars,
    });

    this.dispatchInspection = new NodejsFunction(this, "dispatchInspection", {
      entry: path.join(__dirname, "lambda/dispatchInspection.js"),
      handler: "main",
      role: lambdaRole,
      environment: baseEnvVars,
    });
    this.compileReport = new NodejsFunction(this, "compileReport", {
      entry: path.join(__dirname, "lambda/compileReport.js"),
      handler: "main",
      role: lambdaRole,
      environment: baseEnvVars,
    });
    this.dummyReviewer = new NodejsFunction(this, "dummyReviewer", {
      entry: path.join(__dirname, "lambda/dummyReviewer.js"),
      handler: "main",
      role: lambdaRole,
    });
    this.publishReport = new NodejsFunction(this, "publishReport", {
      entry: path.join(__dirname, "lambda/publishReport.js"),
      handler: "main",
      role: lambdaRole,
      environment: baseEnvVars,
    });
github deepalert / deepalert / lib / deepalert-stack.ts View on Github external
code: lambda.AssetCode.fromAsset("????"),
      compatibleRuntimes: [lambda.Runtime.NODEJS_10_X],
    });
    this.recvAlert = new NodejsFunction(this, "recvAlert", {
      entry: path.join(__dirname, "lambda/recvAlert.js"),
      handler: "main",
      timeout: alertQueueTimeout,
      role: lambdaRole,
      events: [new SqsEventSource(this.alertQueue)],
      environment: Object.assign(baseEnvVars, {
        INSPECTOR_MACHINE: "",
        REVIEW_MACHINE: "",
      }),
    });

    this.submitContent = new NodejsFunction(this, "submitContent", {
      entry: path.join(__dirname, "lambda/submitContent.js"),
      handler: "main",
      role: lambdaRole,
      events: [new SqsEventSource(this.alertQueue)],
      environment: baseEnvVars,
    });

    this.feedbackAttribute = new NodejsFunction(this, "feedbackAttribute", {
      entry: path.join(__dirname, "lambda/feedbackAttribute.js"),
      handler: "main",
      timeout: attributeQueueTimeout,
      role: lambdaRole,
      events: [new SqsEventSource(this.attributeQueue)],
      environment: baseEnvVars,
    });
github deepalert / deepalert / lib / deepalert-stack.ts View on Github external
events: [new SqsEventSource(this.alertQueue)],
      environment: Object.assign(baseEnvVars, {
        INSPECTOR_MACHINE: "",
        REVIEW_MACHINE: "",
      }),
    });

    this.submitContent = new NodejsFunction(this, "submitContent", {
      entry: path.join(__dirname, "lambda/submitContent.js"),
      handler: "main",
      role: lambdaRole,
      events: [new SqsEventSource(this.alertQueue)],
      environment: baseEnvVars,
    });

    this.feedbackAttribute = new NodejsFunction(this, "feedbackAttribute", {
      entry: path.join(__dirname, "lambda/feedbackAttribute.js"),
      handler: "main",
      timeout: attributeQueueTimeout,
      role: lambdaRole,
      events: [new SqsEventSource(this.attributeQueue)],
      environment: baseEnvVars,
    });

    this.dispatchInspection = new NodejsFunction(this, "dispatchInspection", {
      entry: path.join(__dirname, "lambda/dispatchInspection.js"),
      handler: "main",
      role: lambdaRole,
      environment: baseEnvVars,
    });
    this.compileReport = new NodejsFunction(this, "compileReport", {
      entry: path.join(__dirname, "lambda/compileReport.js"),
github deepalert / deepalert / lib / deepalert-stack.ts View on Github external
handler: "main",
      role: lambdaRole,
      environment: baseEnvVars,
    });
    this.compileReport = new NodejsFunction(this, "compileReport", {
      entry: path.join(__dirname, "lambda/compileReport.js"),
      handler: "main",
      role: lambdaRole,
      environment: baseEnvVars,
    });
    this.dummyReviewer = new NodejsFunction(this, "dummyReviewer", {
      entry: path.join(__dirname, "lambda/dummyReviewer.js"),
      handler: "main",
      role: lambdaRole,
    });
    this.publishReport = new NodejsFunction(this, "publishReport", {
      entry: path.join(__dirname, "lambda/publishReport.js"),
      handler: "main",
      role: lambdaRole,
      environment: baseEnvVars,
    });
    this.stepFunctionError = new NodejsFunction(this, "stepFunctionError", {
      entry: path.join(__dirname, "lambda/stepFunctionError.js"),
      handler: "main",
      role: lambdaRole,
      environment: baseEnvVars,
    });
    this.lambdaError = new NodejsFunction(this, "lambdaError", {
      entry: path.join(__dirname, "lambda/lambdaError.js"),
      handler: "main",
      role: lambdaRole,
      environment: baseEnvVars,
github deepalert / deepalert / lib / deepalert-stack.ts View on Github external
environment: baseEnvVars,
    });

    this.dispatchInspection = new NodejsFunction(this, "dispatchInspection", {
      entry: path.join(__dirname, "lambda/dispatchInspection.js"),
      handler: "main",
      role: lambdaRole,
      environment: baseEnvVars,
    });
    this.compileReport = new NodejsFunction(this, "compileReport", {
      entry: path.join(__dirname, "lambda/compileReport.js"),
      handler: "main",
      role: lambdaRole,
      environment: baseEnvVars,
    });
    this.dummyReviewer = new NodejsFunction(this, "dummyReviewer", {
      entry: path.join(__dirname, "lambda/dummyReviewer.js"),
      handler: "main",
      role: lambdaRole,
    });
    this.publishReport = new NodejsFunction(this, "publishReport", {
      entry: path.join(__dirname, "lambda/publishReport.js"),
      handler: "main",
      role: lambdaRole,
      environment: baseEnvVars,
    });
    this.stepFunctionError = new NodejsFunction(this, "stepFunctionError", {
      entry: path.join(__dirname, "lambda/stepFunctionError.js"),
      handler: "main",
      role: lambdaRole,
      environment: baseEnvVars,
    });

@aws-cdk/aws-lambda-nodejs

The CDK Construct Library for AWS Lambda in Node.js

Apache-2.0
Latest version published 1 year ago

Package Health Score

65 / 100
Full package analysis

Popular @aws-cdk/aws-lambda-nodejs functions