RJPearson94 / terraform-aws-open-next-examples

examples for the Open Next Terraform module
https://github.com/RJPearson94/terraform-aws-open-next
9 stars 0 forks source link

Internal server error #2

Closed zhavir closed 5 months ago

zhavir commented 6 months ago

Technical Details

Seems like that the example, out of the box, is not working anymore

here the exception from cloudfront

2024-03-27T14:37:20.944Z undefined ERROR Uncaught Exception
{ "errorType": "Runtime.ImportModuleError", "errorMessage": "Error: Cannot find module 'index'\nRequire stack:\n- /var/runtime/index.mjs", "stack": [ "Runtime.ImportModuleError: Error: Cannot find module 'index'", "Require stack:", "- /var/runtime/index.mjs", " at _loadUserApp (file:///var/runtime/index.mjs:1087:17)", " at async UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1119:21)", " at async start (file:///var/runtime/index.mjs:1282:23)", " at async file:///var/runtime/index.mjs:1288:1" ] }

any suggestion?

Describe the bug

Steps to Reproduce

reproducible by cloning this repo and by applying the listed command in the readme

Expected behaviour

A clear and concise description of what you expected to happen.

Logs

Add logs of the error to help explain your problem.

Additional context

Add any other context about the problem here.

RJPearson94 commented 6 months ago

Hi @zhavir,

Which example were you trying to deploy?

zhavir commented 6 months ago

hello! single-zone

RJPearson94 commented 6 months ago

Hey @zhavir,

Apologies for the slow response. I've not been able to replicate this. The module defaults to deploying the lambda functions using node 20 and ARM. Can I check if you are using node 20 when running the build and are building the app on an ARM machine? If you aren't using an ARM machine to build the app, you can set function_architecture to x86_64 in the terragrunt.hcl

This may resolve your issue. If not, please let me know, and I can try to investigate further.

The example is out of date, so I'm going to update it anyway.

Kind Regards Rob

RJPearson94 commented 5 months ago

@zhavir did this resolve your issue?

zhavir commented 5 months ago

sorry, I decided to go with CDK directly. Anyway I have an Intel based macbook

RJPearson94 commented 5 months ago

Ok no problem @zhavir. I’m going to close this issue, feel free to repo if you try the module again and encounter the same issue