使用cloudformation模板在Cloudfront中添加Lambda @ edge includebody字段? [英] Adding Lambda@edge includebody field in cloudfront using cloudformation template?
问题描述
我正在尝试使用cloudformation在Cloudfront中添加 Lambda @ Edge
关联。根据 aws文档他们只有两个字段,例如 EventType
和 LambdaFunctionARN
。但是我想在cloudformation中添加 IncludeBody
,以便我的 Lambda @ Edge
读取请求的正文。当我尝试在cloudformation中添加 IncludeBody
时,它说的是诸如 invalid property
之类的错误。
I am trying to add Lambda@Edge
association in cloudfront using cloudformation. As per aws docs they had only two fields like EventType
and LambdaFunctionARN
. But i want to add IncludeBody
in cloudformation so that my Lambda@Edge
will read the body of the request . When i try to add IncludeBody
in cloudformation it is saying error like invalid property
.
"LambdaFunctionAssociations":
[
{
"EventType": "origin-response",
"IncludeBody":"true" -- Invalid property error
"LambdaFunctionARN": "arn:aws:lambda:us-east-1:134952096518:function:LambdaEdge:1"
}
]
所以,我不能通过cloudformation添加它。还是我需要从控制台手动完成此操作?
So, can't i add this through cloudformation . Or i need to do it manually from console ?
感谢任何帮助
谢谢
Any help is appreciated Thanks
推荐答案
根据 AWS文档,对于 LambdaFunctionAssociation
有一个 IncludeBody
属性。但是他们也说只能用于查看者请求和原始请求 EventType
s。看来您有一个来源响应 EventType
,因此 IncludeBody
不适用于此处。但是,在官方CloudFormation参考,没有提到 IncludeBody
。因此,我只能猜测CloudFormation现在缺少此功能,您可能只能通过API设置 IncludeBody
。
According to AWS docs, there is an IncludeBody
property for LambdaFunctionAssociation
s. But they also say that it can only be used for "viewer-request" and "origin-request" EventType
s. It looks like you have an "origin-response" EventType
, so IncludeBody
shouldn't be applicable here. Yet, in the official CloudFormation reference, there is no mention of IncludeBody
. So I can only guess that CloudFormation is missing this feature right now and you may only be able to set IncludeBody
via the API.
这篇关于使用cloudformation模板在Cloudfront中添加Lambda @ edge includebody字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!