ラムダ関数を AWS で実行しようとしています。PyAlexa Skill Kit を使用しています。
PyAlexa スキル キットを使用して、Alexa のテスト スキルを作成しました。このキットは、aws ラムダ関数に必要なファイルと構造を簡単に作成します。また、作業を開始するためのいくつかの基本的なテスト発話とサンプル インテント ファイルも生成されます。
私が抱えている問題は、awsラムダ関数にあります。私は、スクリプトが deployment_n ですべてを圧縮していることに気付きました.nはファイル名の前の増分番号であり、これはバージョンであると想定しています。次に、main.py と AlexaHandler.py ファイルがあります。また、pyalexa-skill とバージョンのファイルも含まれています。
私が抱えている問題は、main.py のベース ハンドラーへのメイン コールが、メインのモジュールが存在しないというエラーを返すことです。調査の結果、これは命名の問題であるとのことでしたので、どこに問題があるのか混乱しています。deployment_1main.lambda_function を試しましたが、 main.lambda_function を試したので、どのように名前が間違っているのかわかりません。何かご意見は?
パッケージのビデオはこちら:
https://www.youtube.com/watch?v=O-NaTeq_35s
私のmain.pyコード
import logging
from AlexaHandler import AlexaDeploymentTestHandler
# Main entry point for the Lambda function.
# In the AWS Lamba console, under the 'Configuration' tab there is an
# input field called, 'Handler'. That should be: main.lambda_handler
# Handler: main.lambda_handler
# Role: lambda_basic_execution
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def lambda_handler(event, context):
logging.info("Executing main lambda_handler for YourDeploymentHandler class")
deployment_handler = AlexaDeploymentTestHandler()
handler_response = deployment_handler.process_request(event, context)
return handler_response