我正在尝试添加Lambda@Edge
使用 cloudformation 在 cloudfront 中进行关联。按照aws docs https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-lambdafunctionassociation.html他们只有两个字段,例如EventType
and LambdaFunctionARN
。但我想补充一下IncludeBody
在云信息中,这样我的Lambda@Edge
将读取请求的正文。当我尝试添加时IncludeBody
在cloudformation中它说的是错误invalid property
.
"LambdaFunctionAssociations":
[
{
"EventType": "origin-response",
"IncludeBody":"true" -- Invalid property error
"LambdaFunctionARN": "arn:aws:lambda:us-east-1:134952096518:function:LambdaEdge:1"
}
]
那么,我不能通过 cloudformation 添加这个吗?或者我需要从控制台手动执行此操作?
任何帮助表示赞赏
谢谢
根据AWS docs https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_LambdaFunctionAssociation.html, 有一个IncludeBody
财产为LambdaFunctionAssociation
s. But 他们还说 https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-include-body-access.html它只能用于“查看者请求”和“来源请求”EventType
s。看起来你有一个“起源响应”EventType
, so IncludeBody
不应该适用于此。然而,在官方 CloudFormation 参考 https://github.com/awsdocs/aws-cloudformation-user-guide/blob/master/doc_source/aws-properties-cloudfront-distribution-lambdafunctionassociation.md, 没有提到IncludeBody
。所以我只能猜测CloudFormation现在缺少这个功能,你可能只能设置IncludeBody
通过 API。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)