Skip to content

(lambda-nodejs): Documentation confusingly imports as lambda #22003

@laurelmay

Description

@laurelmay

Describe the issue

In many projects, @aws-cdk/aws-lambda gets imported as lambda; this makes the code examples at https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda_nodejs-readme.html confusing as users may expect that the existing import they have for the aws-lambda package will work.

The documentation is not incorrect if you have your imports the same as in the default.ts-fixture file, doing

import * as lambda from '@aws-cdk/aws-lambda-nodejs';

But I'd argue that's an unlikely way for users to use this package (as they'll often still need other exported values from aws-lambda).

I'd be happy to open a PR to rename this to something like:

import * as lambdaNodejs from '@aws-ckd/aws-lambda-nodejs';

and to make corresponding updates to the README etc; but I wanted to open an issue to discuss before implementing.

Links

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions