Seth Geoghegan
01/12/2022, 8:44 PMexport default function main(app: <http://sst.App|sst.App>): void {
const requestsLayer = (stack) => LayerVersion.fromLayerVersionArn(stack, "requestsLayer", requestsLayerArn);
const psycopgLayer = (stack) => LayerVersion.fromLayerVersionArn(stack, "psycopgLayer", psycopgLayerArn);
app.setDefaultFunctionProps((stack) => {
// other config omitted
const props = {
runtime: "python3.8",
srcPath: "src",
logRetention: config.logRetention,
layers: app.local ? [] :[requestsLayer(stack),psycopgLayer(stack)], // <--- this is working
vpc: vpc,
subnets: vpc.publicSubnets,
securityGroups: [securityGroup],
bundle:{
externalModules: app.local ? [] : [requestsLayer,psycopgLayer] // <--- should this work ??
}
return props;
}
}
thdxr
01/12/2022, 9:09 PMthdxr
01/12/2022, 9:10 PMSeth Geoghegan
01/12/2022, 9:38 PM