sparse-intern-71089
07/10/2019, 4:31 PMwhite-balloon-205
du
of the contents of your zip? Curious what node_modules ended up getting packaged, and how much code ended up getting directly serialized?
Ultimately, we should only be bringing in the things your code actually uses - so they size shouldn't be any larger than it would need to be if you zipped this up manually.swift-painter-31084
07/10/2019, 8:17 PMswift-painter-31084
07/10/2019, 8:17 PM${process.env.gcpKey}
)
const projectId = ${process.env.projectId}
const logging = new Logging.Logging({
projectId: projectId,
credentials: {
client_email: keyFile.client_email,
private_key: keyFile.private_key
}});
const log = logging.log(logName);
const metadata = {
resource: { type: "global" }
};
event.Records.forEach(async (record: { body: {} | undefined; }) => {
const entry = log.entry(metadata, record.body);
await log.write(entry);
console.log(Logged: ${record}
);
});
}
just one dependencylemon-spoon-91807
07/10/2019, 9:22 PMlemon-spoon-91807
07/10/2019, 9:23 PMlemon-spoon-91807
07/10/2019, 9:24 PMlemon-spoon-91807
07/10/2019, 9:24 PMcallback: (e) => { logger.logger(e, 'client-events') },
) by default we include all your node_modules brought in by your package.json.lemon-spoon-91807
07/10/2019, 9:25 PMlemon-spoon-91807
07/10/2019, 9:25 PMlemon-spoon-91807
07/10/2019, 9:25 PM"pulumi": { ... }
section.lemon-spoon-91807
07/10/2019, 9:26 PM"runtimeDependencies": { ... }
where you list only the node_modules that you want to be sucked up into the cloud.lemon-spoon-91807
07/10/2019, 9:26 PM"dependencies"
section so that tools like npm/yarn know about it and pull it down.lemon-spoon-91807
07/10/2019, 9:28 PM@google-cloud/logging
.lemon-spoon-91807
07/10/2019, 9:29 PMnew aws.lambda.CallbackFunction("stackdriver-writer", {
There is a .codePathOptions
property that can be used to flexibly control things here.lemon-spoon-91807
07/10/2019, 9:29 PMswift-painter-31084
07/10/2019, 9:31 PMlemon-spoon-91807
07/10/2019, 9:32 PMswift-painter-31084
07/10/2019, 9:53 PMlemon-spoon-91807
07/10/2019, 9:53 PMlemon-spoon-91807
07/10/2019, 9:53 PMlemon-spoon-91807
07/10/2019, 9:54 PMlemon-spoon-91807
07/10/2019, 9:54 PMswift-painter-31084
07/10/2019, 9:54 PMlemon-spoon-91807
07/10/2019, 9:54 PMlemon-spoon-91807
07/10/2019, 9:55 PMcodePathOptions: { extraExcludePackages... }
yourselflemon-spoon-91807
07/10/2019, 9:55 PMlemon-spoon-91807
07/10/2019, 9:55 PMlemon-spoon-91807
07/10/2019, 9:55 PMswift-painter-31084
07/10/2019, 9:55 PMlemon-spoon-91807
07/10/2019, 9:57 PMlemon-spoon-91807
07/10/2019, 9:57 PMswift-painter-31084
07/10/2019, 9:59 PMlemon-spoon-91807
07/10/2019, 10:00 PMlemon-spoon-91807
07/10/2019, 10:01 PMswift-painter-31084
07/10/2019, 10:01 PMlemon-spoon-91807
07/10/2019, 10:01 PMlemon-spoon-91807
07/10/2019, 10:02 PMcodePathOptions: { extraExcludePackages: ["@..."] }
lemon-spoon-91807
07/10/2019, 10:02 PMlemon-spoon-91807
07/10/2019, 10:02 PMlemon-spoon-91807
07/10/2019, 10:03 PMlemon-spoon-91807
07/10/2019, 10:03 PM"dependencies": {
"@google-cloud/language": "^3.2.1",
lemon-spoon-91807
07/10/2019, 10:03 PM"@google-cloud/language"
swift-painter-31084
07/10/2019, 10:12 PMlemon-spoon-91807
07/10/2019, 10:12 PMlemon-spoon-91807
07/10/2019, 10:12 PMlemon-spoon-91807
07/10/2019, 10:12 PM