Skip to content

(lambda): Specifying insightsVersion triggers warning to make lazy #17133

@evantrimboli

Description

@evantrimboli

What is the problem?

When specifying the insightsVersion property on a lambda function, the following warning is generated:

[Info at /my-app/LambdaInsightsVersions10980] Consider making this CfnMapping a lazy mapping by providing `lazy: true`: either no findInMap was called or every findInMap could be immediately resolved without using Fn::FindInMap

This only started occurring after adding the insightsVersion property to the lambda.

Reproduction Steps

Create a lambda function:

new NodejsFunction('my-fn', {
    runtime: Runtime.NODEJS_14_X,
      ...baseFnOptions,
      vpc,
      functionName: 'foo'
      handler: 'runFoo',
      insightsVersion: LambdaInsightsVersion.VERSION_1_0_98_0
});

What did you expect to happen?

No warning

What actually happened?

A warning.

CDK CLI Version

1.111.0

Framework Version

No response

Node.js Version

14.15.4

OS

Windows

Language

Typescript

Language Version

Typescript 4.3.5

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-lambdaRelated to AWS LambdabugThis issue is a bug.effort/smallSmall work item – less than a day of effortp2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions