José Ribeiro
06/01/2021, 1:08 PMconst api = new sst.Api(this, "Api", {
routes: {
"POST /": {
function: {
srcPath: "src",
handler: "people_data_enrichment/handlers/sns_publisher.handler",
runtime: "python3.8",
environment: {
USER_EVENTS_TOPIC_ARN: topic.topicArn,
},
permissions: [topic],
},
},
},
});
however, in AWS the handler is defined simply as sns_publisher.handler
. If I change the handler to people_data_enrichment.handlers.sns_publisher.handler
then I get the normal behavior again. Otherwise, I get a Unable to import module 'sns_publisher'
Frank
/
people_data_enrichment/
handlers/
sns_publisher.py
José Ribeiro
06/01/2021, 4:57 PMJosé Ribeiro
06/01/2021, 4:58 PMFrank
José Ribeiro
06/01/2021, 7:09 PMFrank
Frank
José Ribeiro
06/02/2021, 1:42 PMJosé Ribeiro
06/02/2021, 3:17 PM"TypeError [ERR_INVALID_URL]: Invalid URL: undefined",
in one of the lambdas when using the app sst start
. I’ll try redeploying the stack, but just wanted to let you know in case it could be sth relatedJosé Ribeiro
06/02/2021, 3:17 PM2021-06-02T15:14:22.500Z ca8f0424-605b-5361-bd41-5d15c2dd1b32 INFO connectAndSendMessage()
2021-06-02T15:14:22.500Z ca8f0424-605b-5361-bd41-5d15c2dd1b32 ERROR Invoke Error
{
"errorType": "TypeError",
"errorMessage": "Invalid URL: undefined",
"code": "ERR_INVALID_URL",
"input": "undefined",
"stack": [
"TypeError [ERR_INVALID_URL]: Invalid URL: undefined",
" at onParseError (internal/url.js:258:9)",
" at new URL (internal/url.js:334:5)",
" at initAsClient (/var/task/node_modules/ws/lib/websocket.js:502:17)",
" at new WebSocket (/var/task/node_modules/ws/lib/websocket.js:71:7)",
" at connectAndSendMessage (/var/task/index.js:55:15)",
" at Runtime.exports.main [as handler] (/var/task/index.js:41:5)",
" at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)"
]
}
Frank
José Ribeiro
06/02/2021, 4:09 PMFrank
SST_DEBUG_ENDPOINT
environment variable set?José Ribeiro
06/02/2021, 4:19 PM