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.

(lambda): Consider renaming `Function`

See original GitHub issue

The current API for @aws-cdk/aws-lambda exposes a type called Function. In addition to being easily confused with the built-in Function type, this clashes with typescript-eslint rules like ban-types, as discussed here. Would it not be more correct to name the export LambdaFunction?

Additionally, @aws-cdk/aws-events-targets does expose a type called LambdaFunction, but (unless I am missing something) would it not be more correct to name that export LambdaFunctionTarget?

Use Case

I’d like this feature so that newcomers to the CDK can easily tell that Function is not the same as the Function built-in type, and can use eslint rules with no additional challenges, and so that the API surface exposed by aws-cdk is more intuitive.

Proposed Solution

for the next major release of aws-cdk:

  • In aws-lambda, rename Function to LambdaFunction
  • In aws-event-targets, rename LambdaFunction to LambdaFunctionTarget (or similar) (There may be other similar renames in that module).


If you would be willing to accept it, I am happy to make a PR for this one

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

github-actions[bot]commented, Jun 17, 2022

This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

nija-atcommented, Apr 19, 2021

I’m happy to leave this open to see if there’s more interest here, or if there are more complaints in this area.

If we don’t see that signal over time, we will have to close this request out. We will need to prioritize which requests to service.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is it possible to rename an AWS Lambda function?
The closest you can get to renaming the lambda function is using an alias, which is a way to name a specific version...
Read more >
Is it possible to rename an AWS Lambda function? - Intellipaat
No, you cannot rename your Lambda function's name ! There are two other options: You can create an Alias of your Lambda function...
Read more >
Renaming and editing description for Lambda functions.
1 Answer. You can't rename the function as the name becomes part of the endpoint. You can change the description by going into...
Read more >
Feature request: Rename lambda function #638 - aws/chalice
It is not possible to rename lambda functions, there are aliases which can serve a similar purpose. I think the only way to...
Read more >
rename of `invoke` function with lambda parameter to `get ...
The issue is related to the fix of KTIJ-5395. Consider the following example: class WInvoke { operator fun invoke ...
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 Post

No results found

github_iconTop Related Hashnode Post

No results found