Amazon web services 如何在Cloudformation模板中为AWS Lambda定义MetricFilter?
我尝试使用AWS::Logs::MetricFilter,遇到了一个无法解决的小问题。在我的Cloudformation模板中,我尝试这样配置它:Amazon web services 如何在Cloudformation模板中为AWS Lambda定义MetricFilter?,amazon-web-services,lambda,amazon-cloudformation,Amazon Web Services,Lambda,Amazon Cloudformation,我尝试使用AWS::Logs::MetricFilter,遇到了一个无法解决的小问题。在我的Cloudformation模板中,我尝试这样配置它: SomeMetricFilter: Type: "AWS::Logs::MetricFilter" Properties: FilterPattern: "*thing just happened*" LogGroupName: "/aws/lambda/some-lambda-name-ISW1N3LSL
SomeMetricFilter:
Type: "AWS::Logs::MetricFilter"
Properties:
FilterPattern: "*thing just happened*"
LogGroupName: "/aws/lambda/some-lambda-name-ISW1N3LSLNK0"
MetricTransformations:
-
MetricValue: "1"
MetricNamespace: "Name/Space"
MetricName: "VeryVerboseMetricName"
为此AWS Lambda创建的日志组具有一组随机字母和数字作为前缀:ISW1N3LSLNK0
这使得在此阶段无法配置过滤器。也许有人能帮我一下,告诉我如何处理这件事?这件事很愚蠢。我只需要为lambda函数定义一个名称,如:
FunctionName: !Sub "some-function-name"
然后日志组将具有相同的名称