Closed pocesar closed 4 years ago
Looks like a bug! The API Gateway stuff is in need of a re-write I think. Will start debugging this one ASAP.
I think it's a consequence of Build
vs Run
. My hunch is that mapResource
is not called at runtime so the result of this.resourceMappings[uniqueId]
is undefined
.
Yep!
It's called in makeHandler
:
Which is called in addMethod
inside a Build
context:
Just released version 0.11.0 that should fix this. Hope it works now!
I tried many ways using apigateway with executorService, the environment variables are properly set, but the code always return the same error:
I put some
console.log
s on the api-gateway/resource to see what is going on, it seems that the call to "findResource" is assigning an "undefined" resource on:and since "resourceMappings" is empty from the logs
maybe a racing condition? because "resource" isn't empty when
mapResource
is called. as you can see, resourceMappings is empty, but index is not, which seems weird, since the environment variable forresource_id_apibusiness7765B3D2
is being set ton2fjvw
, which means it's being called at least in some moment