问题
I have this static website that has a form with a couple of fields. CloudFront is on front of the bucket routing traffic to the site.
Them form in question naturally has a button that POST to '#'.
Is there a way I could make the hits on the button trigger a lambda function with the content of the form's fields?
Thanks in advance.
回答1:
API Gateway is typically used to call the Lambda function from a Web Page.
Here is a basic tutorial matching your architecture: https://aws.amazon.com/getting-started/projects/build-serverless-web-app-lambda-apigateway-s3-dynamodb-cognito/
来源:https://stackoverflow.com/questions/60917574/trigger-lambda-from-a-button-in-a-static-website-in-s3