Update `gcp-ts-functions` to show how to use an explicit runtime.
MODIFY
gcp-ts-functions/index.ts
gcp-ts-functions/index.ts
import * as gcp from "@pulumi/gcp";
+/**
+ * Deploy a function using the default runtime.
+ */
const greeting = new gcp.cloudfunctions.HttpCallbackFunction("greeting", (req, res) => {
res.send(`Greetings from ${req.body.name || "Google Cloud Functions"}!`);
});
@@ -15,3 +18,16 @@ const invoker = new gcp.cloudfunctions.FunctionIamMember("invoker", {
});
export const url = greeting.httpsTriggerUrl;
+
+/**
+ * Deploy a function using an explicitly set runtime.
+ */
+const runtime = "nodejs14"; // https://cloud.google.com/functions/docs/concepts/exec#runtimes
+const explicitRuntimeGreeting = new gcp.cloudfunctions.HttpCallbackFunction(`greeting-${runtime}`, {
+ runtime: runtime,
+ callback: (req, res) => {
+ res.send(`Greetings from ${req.body.name || "Google Cloud Functions"}!`);
+ },
+});
+
+export const nodejs14Url = explicitRuntimeGreeting.httpsTriggerUrl;

Update `gcp-ts-functions` to show how to use an explicit runtime. (#924)