ancient-park-44711
09/18/2023, 2:30 PMglamorous-jelly-86558
09/18/2023, 3:24 PMimport * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const bucket = new gcp.storage.Bucket("bucket", {location: "US"});
const archive = new gcp.storage.BucketObject("archive", {
bucket: bucket.name,
source: new pulumi.asset.FileAsset("./path/to/zip/file/which/contains/code"),
});
const _function = new gcp.cloudfunctions.Function("function", {
description: "My function",
runtime: "nodejs16",
availableMemoryMb: 128,
sourceArchiveBucket: bucket.name,
sourceArchiveObject: archive.name,
triggerHttp: true,
entryPoint: "helloGET",
});
// IAM entry for all users to invoke the function
const invoker = new gcp.cloudfunctions.FunctionIamMember("invoker", {
project: _function.project,
region: _function.region,
cloudFunction: _function.name,
role: "roles/cloudfunctions.invoker",
member: "allUsers",
});
Source: https://www.pulumi.com/registry/packages/gcp/api-docs/cloudfunctions/function/runtime: "nodejs16",
<-- this line seems like the line you want to tweakancient-park-44711
09/18/2023, 5:49 PMglamorous-jelly-86558
09/18/2023, 7:38 PMcloudfunctionsv2
resource type: https://www.pulumi.com/registry/packages/gcp/api-docs/cloudfunctionsv2/function/