question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(aws-lambda): regionInfo.cloudwatchLambdaInsightsArn is not a function

See original GitHub issue

❓ General Issue

The Question

Upgraded all @aws-cdk (and the cli) from 1.74.0 to 1.122.0 and @aws-cdk/aws-lambda is triggering this error.

Lambda Insights is not enabled in AWS nor have I defined the insightsVersion property. But to my understanding of the docs that should not be necessary.

Am I missing some documentation between versions?

Environment

  • CDK CLI Version: 1.122.0
  • Module Version: 1.122.0
  • Node.js Version: 14.7.6
  • OS: Debian (docker node:lts)
  • Language (Version): Javascript

Other information

$ cdk bootstrap
/node_modules/@aws-cdk/aws-lambda/lib/lambda-insights.js:46
        const versionExists = region_info_1.RegionInfo.regions.some(regionInfo => regionInfo.cloudwatchLambdaInsightsArn(insightsVersion));
                                                                                             ^
TypeError: regionInfo.cloudwatchLambdaInsightsArn is not a function
    at /node_modules/@aws-cdk/aws-lambda/lib/lambda-insights.js:46:94
    at Array.some (<anonymous>)
    at Function.fromInsightsVersion (/node_modules/@aws-cdk/aws-lambda/lib/lambda-insights.js:46:64)
    at Object.<anonymous> (/node_modules/@aws-cdk/aws-lambda/lib/lambda-insights.js:69:64)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at require (internal/modules/cjs/helpers.js:92:18)
Subprocess exited with error 1
const cdk = require('@aws-cdk/core');
const { AppStack } = require('../lib/app-stack');

const app = new cdk.App();
new AppStack(app, 'AppStack', {
  env: {
    region: process.env.AWS_DEFAULT_REGION,
    account: process.env.AWS_ACCOUNT,
  },
});
class AppStack extends cdk.Stack {
   const authApi = new lambda.Function(this, `${this.serviceId}AuthApi`, {
      runtime: lambda.Runtime.NODEJS_12_X,
      code: lambda.Code.fromAsset(path.join(__dirname, '../src/resources')),
      handler: 'api.auth',
      vpc: vpc,
      vpcSubnets: subnetSelection,
      securityGroups,
      environment: {
        APP_COOKIE_DOMAIN: process.env.APP_COOKIE_DOMAIN,
        APP_URL: process.env.APP_URL,
        STAGE: process.env.STAGE,
      },
    });
}
module.exports = { AppStack };

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
PatrikElfstromcommented, Sep 17, 2021

@nija-at @JahnKhan Yes the node modules seemed to have been cached in the cicd. Cleaning the cache solved the issue. Thanks!

0reactions
github-actions[bot]commented, Sep 17, 2021

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Lambda Insights in Amazon CloudWatch
This page describes how to enable and use Amazon CloudWatch Lambda Insights to diagnose issues with your AWS Lambda functions.
Read more >
Enabling Lambda Insights
Amazon CloudWatch Lambda Insights CloudWatch Lambda Insights is a monitoring and troubleshooting solution for serverless applications running on AWS Lambda.
Read more >
aws-cdk.aws-lambda - Python Package Health Analysis - Snyk
This construct library allows you to define AWS Lambda Functions. fn = lambda_.Function(self, "MyFunction", runtime=lambda_.Runtime.NODEJS_16_X, handler="index ...
Read more >
Enabling Lambda Insights for the arm64-based ... - GitHub
I was building a Lambda container image using public.ecr.aws/lambda/python:3.9-arm64, and the following Error occured during docker build: ...
Read more >
aws-cdk/aws-lambda@1.181.1 - jsDocs.io
Given an opaque (token) ARN, returns a CloudFormation expression that extracts the qualifier (= version or alias) from the ARN.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found