前提・実現したいこと
お世話になります。
APIGatewayとLambdaを使用し登録フォームを作成しようと考えています。
その前段階として、こちらのサイトを参考に、
APIGateway→AWSLambdaを叩きPOST送信するWEBページを作成したいです。
発生している問題・エラーメッセージ
記載の手順で作成を行って、ブラウザから動作を確認したところ、
WEBページを開いた時点でコンソールに以下のように表示されます。
Failed to load resource: the server responded with a status of 403 (Forbidden)
おそらくこちらの設定の問題だと思うのですが、
なにをどう変更すればよいのか分かりません・・・。
また、送信ボタンを押下すると以下のページが表示されます。
This XML file does not appear to have any style information associated with it. The document tree is shown below. <Error> <Code>MethodNotAllowed</Code> <Message> The specified method is not allowed against this resource. </Message> <Method>POST</Method> <ResourceType>OBJECT</ResourceType> <RequestId>B482737DEB9C8A77</RequestId> </Error>
該当のソースコード
APIGatewayからAWSLambdaを叩く(POST送信)に記載のソースを使用しました。
試したこと
403のエラーなのでプログラムの問題かと思い確認しましたが、
特におかしなところも無いように思います。
またボタン押下後のエラーはPOSTについて出ているようだったので
APIGatewayの設定を確認しましたがこちらも特に問題ありませんでした。
Formの作成がなかなかスムーズにいかず、苦戦しております・・・。
もし原因に心当たりのある方がいらっしゃいましたら、ご教授お願い致します。
宜しくお願い致します。
追記
APIGatewayでの単体テスト結果
{ "message": "Unsupported Media Type" }
Lambdaでの単体テスト結果
{ "errorMessage": "RequestId: 833a3f57-5a31-11e8-872e-ad422717381f Process exited before completing request" }
START RequestId: 833a3f57-5a31-11e8-872e-ad422717381f Version: $LATEST 2018-05-18T00:22:14.291Z 833a3f57-5a31-11e8-872e-ad422717381f TypeError: Cannot read property 'param1' of undefined at exports.handler (/var/task/index.js:4:47) END RequestId: 833a3f57-5a31-11e8-872e-ad422717381f REPORT RequestId: 833a3f57-5a31-11e8-872e-ad422717381f Duration: 39.41 ms Billed Duration: 100 ms Memory Size: 512 MB Max Memory Used: 46 MB RequestId: 833a3f57-5a31-11e8-872e-ad422717381f Process exited before completing request

回答1件
あなたの回答
tips
プレビュー