Skip to content

Commit

Permalink
Update packages/aws-cdk-lib/aws-lambda/lib/function.ts
Browse files Browse the repository at this point in the history
Co-authored-by: paulhcsun <47882901+paulhcsun@users.noreply.github.com>
  • Loading branch information
pahud and paulhcsun authored Apr 12, 2024
1 parent 0f58e1e commit 4ff9cf1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/aws-cdk-lib/aws-lambda/lib/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -672,8 +672,8 @@ export class Function extends FunctionBase {
*/
public static fromFunctionArn(scope: Construct, id: string, functionArn: string): IFunction {
/**
* First, validate the functionArn string. If it's ARN with trailing version or alias,
* we trim off the trailing to retrieve the real functionArn.
* If the functionArn has a trailing version or alias (more than 7 parts when split by ":",
* we trim off the trailing version/alias to retrieve the real functionArn.
* See lambda resource ARN format here: https://docs.aws.amazon.com/lambda/latest/dg/lambda-api-permissions-ref.html
*/
const parts = functionArn.split(':');
Expand Down

0 comments on commit 4ff9cf1

Please sign in to comment.