magnificent-lifeguard-15082
11/17/2021, 8:45 PMpulumi.cloud.Table()
will register and deploy resources when run with the cli but is also used as a reference for table.get()
in a serverless function. This is a holy grail and looking forward to seeing more of this from pulumi!
My question though is around how would pulumi optimise the bundling of functions to not include all of the deployment runtime & engine? I'm wondering if the module level deploymentOnlyModule
export has anything to do with it and wondering how I would optimise similar code/components in user land?
For additional context I have a separate process for bundling and do not want to rely on pulumi inline handlers as they may also be other runtimes (ie. not typescript->nodejs)millions-furniture-75402
11/17/2021, 8:52 PMnpm run build
and something like this in your plan:
const lambdaFunctionArgs = {
code: new pulumi.asset.FileArchive("./dist/app"),
memorySize: 128,
environment: {
variables: {
API_BASE_PATH: apiBasePath,
},
},
handler: "lambdaApiHandler.handler",
role: applicationRole.arn,
runtime: aws.lambda.NodeJS12dXRuntime,
};
const lambdaFunctionApi = new aws.lambda.Function(
`${appName}-api`,
lambdaFunctionArgs,
{ dependsOn: [applicationRole] },
);
magnificent-lifeguard-15082
11/18/2021, 7:58 AMmillions-furniture-75402
11/18/2021, 1:32 PM