ChatGPT-CodeReview icon indicating copy to clipboard operation
ChatGPT-CodeReview copied to clipboard

deploy on aws lambda

Open yunho-ju opened this issue 2 years ago • 4 comments

Hello! First of all, I really like your project. I have a question: I'm currently trying to deploy it on AWS Lambda. Could you please guide me on how to do that? Thank you.

yunho-ju avatar Sep 13 '23 02:09 yunho-ju

  1. You should prepare the required env variable in the .env file
  2. yarn build:lambda to build the aws lambda function
  3. use serverless for deploying. (AWS account is required)

anc95 avatar Sep 13 '23 02:09 anc95

 "errorType": "Runtime.ImportModuleError",
    "errorMessage": "Error: Cannot find module '/var/task/lambda'\nRequire stack:\n- /var/runtime/index.mjs",
    "stack": [
        "Runtime.ImportModuleError: Error: Cannot find module '/var/task/lambda'",
        "Require stack:",
        "- /var/runtime/index.mjs",
        "    at _loadUserApp (file:///var/runtime/index.mjs:1061:17)",
        "    at async UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1093:21)",
        "    at async start (file:///var/runtime/index.mjs:1256:23)",
        "    at async file:///var/runtime/index.mjs:1262:1"
    ]

after deploy i got above error at aws lambda from cloudwatch log

what did i miss?

@anc95

yunho-ju avatar Sep 13 '23 04:09 yunho-ju

I found.

in serverless.yml file change handler path like below

    handler: lambda/index.webhooks 

yunho-ju avatar Sep 13 '23 05:09 yunho-ju

@yunho-medi You deployed a webhook. Then you should create a github app with the webhook endpoint configured, then install the app to your repo, and event such as a pull request open / sync happened, would invoke the webhook for reviewing

anc95 avatar Sep 13 '23 05:09 anc95