Michael Robellard
03/18/2022, 7:36 PMAshishkumar Pandey
03/18/2022, 8:30 PMMichael Robellard
03/18/2022, 8:34 PMThomas Ankcorn
03/18/2022, 10:54 PMThomas Ankcorn
03/18/2022, 10:54 PMAshishkumar Pandey
03/19/2022, 12:20 AMFrank
bundle.installCommands
of a specific route to run a different pip commandFrank
new Api(this, "Api", {
defaultFunctionProps: {
srcPath: "...",
},
route: {
"GET /route1": "...",
"GET /route2": "...",
"GET /route3": {
handler: "...",
bundle: {
installCommands: [
'pip install ...',
],
},
},
});
Frank
Michael Robellard
03/20/2022, 5:19 AMFrank
myLayer
, put a requirements.txt in it and does a pip install. Then in ur SST code:
const layer = new lambda.LayerVersion(this, 'MyLayer', {
code: lambda.Code.fromAsset(path.join(__dirname, 'myLayer')),
});
new Api(this, "Api", {
defaultFunctionProps: {
layers: [layer],
},
routes: ...
});