smallbirds
smallbirds

Reputation: 1067

How to get the ARN of a lambda function in CDK

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'

Upvotes: 7

Views: 8172

Answers (1)

Marcin
Marcin

Reputation: 238209

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

functionArn - string - ARN of this function.

Upvotes: 8

Related Questions