作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想为我的 lambda 函数启用 x-ray
,下面是模板文件:
Resources:
HelloWorldFunction:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
CodeUri: hello-world/
Handler: app.lambdaHandler
Runtime: nodejs8.10
TracingConfig:
Mode: Active
Events:
HelloWorld:
Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api
Properties:
Path: /hello
Method: post
通过 sam deploy
命令部署时出现以下错误:
Failed to create the changeset: Waiter ChangeSetCreateComplete failed: Waiter encountered a terminal failure state Status: FAILED. Reason: Transform AWS::Serverless-2016-10-31 failed with: Invalid Serverless Application Specification document. Number of errors found: 1. Resource with id [HelloWorldFunction] is invalid. property TracingConfig not defined for resource of type AWS::Serverless::Function
它显示 TracingConfig
未定义。为我的 lambda 配置它的正确方法是什么?
最佳答案
基于此docs ,它应该只是Tracing
。所以正确的应该如下
Resources:
HelloWorldFunction:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
CodeUri: hello-world/
Handler: app.lambdaHandler
Runtime: nodejs8.10
Tracing: Active
Events:
HelloWorld:
Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api
Properties:
Path: /hello
Method: post
关于amazon-web-services - 如何在cloudformation上配置 `TracingConfig`?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56250893/
我想为我的 lambda 函数启用 x-ray,下面是模板文件: Resources: HelloWorldFunction: Type: AWS::Serverless::Functio
我想为我的 lambda 函数启用 x-ray,下面是模板文件: Resources: HelloWorldFunction: Type: AWS::Serverless::Functio
我是一名优秀的程序员,十分优秀!