[{"data":1,"prerenderedAt":80},["ShallowReactive",2],{"/2025/12/25-sns-https-fanout-to-api-gateway-error":3},{"id":4,"title":5,"body":6,"date":71,"description":49,"extension":72,"meta":73,"navigation":74,"path":75,"robots":76,"seo":77,"stem":78,"__hash__":79},"posts/2025/12/25 SNS-HTTPS-fanout-to-API-Gateway-error.md","25 SNS HTTPS Fanout To API Gateway Error",{"type":7,"value":8,"toc":68},"minimark",[9,18,25,28,31,33,36,50,52],[10,11,13],"post-title",{":date":12},"date",[14,15,17],"h1",{"id":16},"sns-https-fanout-to-api-gateway-error","SNS HTTPS Fanout to API Gateway Error",[19,20,21],"notes",{},[22,23,24],"p",{},"This is a repost from my old blog. First posted in 11/11/2020.",[26,27],"br",{},[22,29,30],{},"In one of my projects, I have an Amazon SNS subscription set up to fan out to HTTPS endpoint that is backed by Amazon API Gateway. The API Gateway has mapping template applied.",[26,32],{},[22,34,35],{},"It went smoothly during test with Postman and the API Gateway test, but when SNS sends the Notification message, it threw an error. On CloudWatch log, the error message is:",[37,38,39],"code-block",{},[40,41,46],"pre",{"className":42,"code":44,"language":45},[43],"language-text","Execution failed: null\n","text",[47,48,44],"code",{"__ignoreMap":49},"",[26,51],{},[22,53,54,55,62,63,67],{},"Apparently SNS sends request with Content-Type of ",[47,56,61],{"className":57},[58,59,60],"bg-gray-200","p-2","rounded","text/plain"," although the request body contains json while I only had mapping set for ",[47,64,66],{"className":65},[58,59,60],"application/json",". So adding mapping template for text/plain solves my problem.",{"title":49,"searchDepth":69,"depth":69,"links":70},2,[],"2025-12-25T00:00:00.000Z","md",{},true,"/2025/12/25-sns-https-fanout-to-api-gateway-error",null,{"title":5,"description":49},"2025/12/25 SNS-HTTPS-fanout-to-API-Gateway-error","DfFQiGH0U2SMuQPsXSBck_52dc9gtkLyrlIL0Q92l90",1785167452052]