Amazon web services 是否可以在AWS CDK中定义多个lambda目的地?

Amazon web services 是否可以在AWS CDK中定义多个lambda目的地?,amazon-web-services,aws-cdk,Amazon Web Services,Aws Cdk,我在AWS CDK中具有以下lambda函数: checker_destination = lambda_destinations.LambdaDestination(checker_function) sns_destination = lambda_destinations.SnsDestination(monitoring_topic) rls_function = _lambda.Function( #Other parameters left out

我在AWS CDK中具有以下lambda函数:

checker_destination = lambda_destinations.LambdaDestination(checker_function)
sns_destination = lambda_destinations.SnsDestination(monitoring_topic)
    
    rls_function = _lambda.Function(
        #Other parameters left out for this question since they are not relevant
        on_success=checker_destination, 
        on_failure=checker_destination
    )

但是,我还想将sns目的地添加到on_failure参数中。这在AWS Cdk中可能吗?on_failure需要一个目的地,而不是一组目的地,因此[checker_destination,sns_destination]不起作用

否,但这不是CDK的限制,而是Lambda服务本身的限制,您只能有一个成功和失败目标,而不是多个。请参见API中的

如果你想要多个目标,你需要自己创建扇出,例如指定SNS作为目标,然后订阅多个SNS主题