rileydakota / valheim-ecs-fargate-cdk

AWS CDK/Cloudformation to deploy a Valheim Server using ECS Fargate!
78 stars 24 forks source link

Use named handler export rather than default export for lambdas #37

Open ajmacd opened 1 year ago

ajmacd commented 1 year ago

The lambdas were erroring with:

{
    "errorType": "Runtime.HandlerNotFound",
    "errorMessage": "index.handler is undefined or not exported"
}

AFAICT, the handler function needs to be a named, and not default, export.

Furthermore, it appeared that, in some cases at least, the startstop lambda could exit before the network request to the ECSClient completed. This also now awaits the response before exiting the lambda.

Finally, this causes the status lambda to always return some value.

sonarcloud[bot] commented 1 year ago

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell B 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

ajmacd commented 1 year ago

@RyoshiKayo interested in your perspective here if you get a chance to take a look, as the (apparently) breaking changes were due to the improvements you made earlier this year. Curious to know why you weren't hitting the issue.