admin管理员组文章数量:1355996
I've created a small AWS Lambda that sends an email using SES. I'm looking to hookup a contact us form from a static website to this lambda.
Is it possible to have the contact us form post directly to a url of the lambda? I'm not using a server side framework and would really like to avoid it, what are my options? Is there client side Javascript way to invoke the lambda?
I've created a small AWS Lambda that sends an email using SES. I'm looking to hookup a contact us form from a static website to this lambda.
Is it possible to have the contact us form post directly to a url of the lambda? I'm not using a server side framework and would really like to avoid it, what are my options? Is there client side Javascript way to invoke the lambda?
Share Improve this question asked Jun 23, 2015 at 19:59 MikebMikeb 7917 silver badges25 bronze badges 1- Adding cloudfront as a proxy in order to use the same origin is another alternative to CORS: codeengine./articles/process-form-aws-api-gateway-lambda – Dave Maple Commented Jan 6, 2017 at 14:56
1 Answer
Reset to default 9Wrote a blog post about this.
This is totally doable. It's a matter of using AWS Cognito to call that function.
- You have your lambda function in place. Grand.
- Create a new Cognito group.
- Give the unauth'ed Cognito group permissions to execute the lambda function.
- Wire it all up in the browser. I have some example code here… https://github./chadbaudoin/lambda-twilio/blob/master/index.html
The “hard” part is making sure that the IAM settings for the Cognito group and the Lambda function are all set up correctly. I used this tutorial pretty heavily, but used cognito to execute so I wasn't exposing keys.
http://lg.io/2015/05/16/the-future-is-now-and-its-using-aws-lambda.html
本文标签: javascriptTriggering a AWS Lambda from a form postStack Overflow
版权声明:本文标题:javascript - Triggering a AWS Lambda from a form post - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744035205a2579644.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论