aws-samples / aws-saas-factory-eks-saas-workshop

MIT No Attribution
56 stars 23 forks source link

Pipeline Fails #94

Closed mobytoby closed 1 year ago

mobytoby commented 1 year ago
          Everything worked great until I got to Lab 4, Step 7 **Silo tenant onboarding pipeline.**  The pipeline repeatedly failed and quit while trying to create the Lambda functions. 

A representative example of the Cloudwatch logs is below:

2023-06-07T01:07:45.072Z    undefined   ERROR   Uncaught Exception  
{
    "errorType": "Runtime.ImportModuleError",
    "errorMessage": "Error: Cannot find module 'aws-sdk'\nRequire stack:\n- /var/task/index.js\n- /var/runtime/index.mjs",
    "stack": [
        "Runtime.ImportModuleError: Error: Cannot find module 'aws-sdk'",
        "Require stack:",
        "- /var/task/index.js",
        "- /var/runtime/index.mjs",
        "    at _loadUserApp (file:///var/runtime/index.mjs:997:17)",
        "    at async UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1032:21)",
        "    at async start (file:///var/runtime/index.mjs:1195:23)",
        "    at async file:///var/runtime/index.mjs:1201:1"
    ]
}

Originally posted by @lkersten in https://github.com/aws-samples/aws-saas-factory-eks-saas-workshop/issues/90#issuecomment-1581537561

tobuck-aws commented 1 year ago

Fixed with this commit. Sorry for this. The issue turned out to be that Node 18 is incompatible with AWS SDK v2. It is compatible with v3, but that would require a bunch of other changes. We're rolling back our lambdas to Node 16 in the short term, and will make the larger v2->v3 SDK changes in a subsequent update.