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

MIT No Attribution
53 stars 23 forks source link

Script cannot build the baseline infrastructure #90

Closed lkersten closed 1 year ago

lkersten commented 1 year ago

The baseline script appears to finish but does not create all of the infrastructure. An error message briefly appears that says:

"This CDK CLI is not compatible with the CDK library used by your application. Please upgrade the CLI to the latest version.
(Cloud assembly version mismatch: Maximum schema version supported is 31.0.0, but found 32.0.0)"

After running npm install -g aws-cdk to upgrade the CDK CLI and running the baseline script again, it generates several additional errors and fails to complete.

tobuck-aws commented 1 year ago

Thanks for the note, I'll take a look and report back on this issue with findings.

tobuck-aws commented 1 year ago

@lkersten this should be fixed. Thanks for reporting.

lkersten commented 1 year ago

Thank you for responding so quickly. Unfortunately, I am still getting the same error. This time, however, it occurred when I tried to build the EKS cluster. In the past, I was able to build the EKS cluster and get 2 nodes. Now, I cannot build the EKS cluster. Attached is the screen shot of the error message.

SaaS_WorkshopError

tobuck-aws commented 1 year ago

@lkersten this was my bad. I changed the CDK versions in the CDK projects (EKS and Baseline), but failed to update the CDK version in the setup.sh script. I just did that with this commit. You should just be able to npm i -g aws-cdk@2.81.0, or pull the latest and re-run setup.sh

lkersten commented 1 year ago

Once again, thank you for responding so quickly. Unfortunately, the baseline script still does not install all of the necessary components, and according to CloudFormation, the rootstack fails and is automatically rolled back. Attached is the CloudFormation error message. One of the symptoms is the user pool is never created in Cognito, so it's impossible to log in to the Admin Site.

RootstackError

tobuck-aws commented 1 year ago

I suspect this happened because CF tried to create an artifact that was already in your environment. We have unique names on most artifacts, but some don't. Can you please make sure that all Cognito user pools were deleted, as well as all DynamoDB Tables?

lkersten commented 1 year ago

No Cognito user pools were ever created, but I did find some legacy DynamoDB tables that I deleted manually. Everything seems to be working now. Thank you.

lkersten 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"
    ]
}