AWS Lambda CloudTrail 事件 SAM 映射

AWS Lambda CloudTrail Events SAM Mapping

能否请您提供 information/link 我如何通过 AWS SAM 创建下一个:

1. Go to services → CloudWatch → Rules → click on Create rule . 2. Event Source → choose Event Pattern → select CloudWatch Logs in Service Name , AWS API Call via CloudTrail in Event Type (If you don’t have Trail setup in CloudTrail, do first. To get help refer this document), CreateLogGroup in Specific operation(s)→ Targets → select Lambda function → select previously created lambda function → click on Configure details . 3. Give Name, Description, State should be enabled → click on Create rule . (摘自 https://medium.com/tensult/manage-aws-cloudwatch-log-group-retention-using-automation-26add478b0c5 文章。)

我没有找到任何关于如何在 AWS SAM template.yaml 文件中为 lambda 函数(第 2 步)描述此事件源/事件类型(AWS API 通过 CloudTrail 调用)的信息。

抱歉,如果我提供的这个问题的标题不完全正确,我不确定如何正确地提出这个问题 - 请联系我,我会更改它。

AWS SAM 团队回答说 SAM 本身不支持 CloudTrail+Lambda。 有关详细信息,请查看:https://github.com/awslabs/serverless-application-model/issues/550