Adding Lambda@edge includebody field in cloudfront using cloudformation template?

帅比萌擦擦* 提交于 2020-01-06 03:54:22

问题


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"
            }
]

So, can't i add this through cloudformation . Or i need to do it manually from console ?

Any help is appreciated Thanks


回答1:


According to AWS docs, there is an IncludeBody property for LambdaFunctionAssociations. But they also say that it can only be used for "viewer-request" and "origin-request" EventTypes. 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.



来源:https://stackoverflow.com/questions/53206414/adding-lambdaedge-includebody-field-in-cloudfront-using-cloudformation-template

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!