如何在 CDK 中获取 lambda 函数的 ARN

How to get the ARN of a lambda function in CDK

我已经使用 CDK 几个月了,我正面临一个可能有简单解决方案的问题。我已经在互联网上搜索了很长时间,但没有找到解决方案。我正在创建一个 lambda 函数:

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

我想获取这个 lambda 的 ARN,我尝试了不同的变体:

EventSplitter.attrArn, EventSplitter.Arn, EventSplitter.LambdaArn

但它总是抱怨 属性 'attrArn' does not exist on type 'Function'

根据the docs,一个函数的ar是:

functionArn - string - ARN of this function.