How to get the ARN of a lambda function in CDK

Viewed 2516

I have worked with CDK for a couple of months now and I am facing a problem that probably has a simple solution. I have searched the internet for quite some time, without finding a solution. I am creating a lambda function:

const EventSplitter = new lambda.Function(this, 'EventSplitter', {
      runtime: lambda.Runtime.PYTHON_3_8,  
      code: lambda.Code.fromAsset('lambda'), 
      handler: 'okta_event_splitter.lambda_handler'  
    });

and i want go get the ARN of this lambda, I have tried different variants of:

EventSplitter.attrArn, EventSplitter.Arn, EventSplitter.LambdaArn

but it always complain about Property 'attrArn' does not exist on type 'Function'

1 Answers

According to the docs, the arn of a function is:

functionArn - string - ARN of this function.

Related