Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 811
Private Avatar asked Aug 04 '26 14:08

Private


1 Answers

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.

like image 130
daktaklakpak Avatar answered Aug 07 '26 21:08

daktaklakpak



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!