-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(lambda): Validate Lambda "functionName" parameter #17970
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opening the PR! A couple of comments, and I agree with @jumic in that we need to consider tokens as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm not sure why the linter didn't find these but I like my spaces :)
@Dzhuneyt, it's been a while since there was any action on this PR. Are you still available to work on this? |
Yeah. Sorry, I was on vacation. |
Pull request has been modified.
Co-authored-by: Kaizen Conroy <36202692+kaizen3031593@users.noreply.github.com>
@kaizen3031593 @jumic addressed your comments above. Let me know if you see anything else that can be improved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
almost there @Dzhuneyt -- just a question about the allowed length of a lambda function name.
@@ -690,6 +690,15 @@ export class Function extends FunctionBase { | |||
} | |||
this._architecture = props.architecture ?? (props.architectures && props.architectures[0]); | |||
|
|||
if (props.functionName && !Token.isUnresolved(props.functionName)) { | |||
if (props.functionName.length > 140) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this says that the length cannot be greater than 64 characters. Where are you gettintg the 140 from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've confirmed that the number is 64 here. Going to update this PR accordingly.
new lambda.Function(stack, `foo${invalidChar}`, { | ||
code: new lambda.InlineCode('foo'), | ||
handler: 'index.handler', | ||
runtime: lambda.Runtime.NODEJS_10_X, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this runtime has an end-of-life set for 2/14/22. lets use Node 12 or 14.
new lambda.Function(stack, 'foo', { | ||
code: new lambda.InlineCode('foo'), | ||
handler: 'index.handler', | ||
runtime: lambda.Runtime.NODEJS_10_X, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here too
Pull request has been modified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for getting this started @Dzhuneyt, just made a few modifications to get this across the finish line.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Closes aws#13264 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Closes #13264
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license