Jan Nylund
06/05/2022, 12:04 PMJan Nylund
06/05/2022, 12:05 PMJan Nylund
06/05/2022, 12:05 PMJan Nylund
06/05/2022, 12:06 PMFrank
Frank
how to manage this to get separate requirements.txtImagine u r creating an Api, u can structure ur functions like this:
/
sst.json
stack/
ApiStack.ts
backend/
function1/
requirements.txt
handler.py
function2/
requirements.txt
handler.py
...
And in ur ApiStack, u can do
new Api(stack, "Api", {
routes: {
"GET /route1": {
srcPath: "backend/function1",
handler: "handler.main",
},
"GET /route2": {
srcPath: "backend/function2",
handler: "handler.main",
},
...
},
});
Frank
Jan Nylund
06/05/2022, 4:35 PMJan Nylund
06/05/2022, 5:52 PMJan Nylund
06/05/2022, 5:54 PMnew Cron
stack, so how do I pass in a reference ot a dynamodb table that is to be populated by a cron job?Jan Nylund
06/05/2022, 5:54 PMJan Nylund
06/05/2022, 6:10 PMJan Nylund
06/05/2022, 6:35 PMconst cron = new Cron(stack, "Cron", {
schedule: "rate(1 minute)",
job: {
function: {
permissions: [table],
environment: {
TABLE_NAME: table.tableName,
},
handler: "main.handler"
}
}
});
Jan Nylund
06/05/2022, 8:09 PMJan Nylund
06/05/2022, 8:13 PM