diff --git a/src/v1/function-builder.ts b/src/v1/function-builder.ts index 0f813ec96..c7e5daa3e 100644 --- a/src/v1/function-builder.ts +++ b/src/v1/function-builder.ts @@ -53,7 +53,7 @@ import * as testLab from "./providers/testLab"; */ function assertRuntimeOptionsValid(runtimeOptions: RuntimeOptions): boolean { const mem = runtimeOptions.memory; - if (mem && !(mem instanceof ResetValue) && !VALID_MEMORY_OPTIONS.includes(mem)) { + if (mem && typeof mem !== "object" && !VALID_MEMORY_OPTIONS.includes(mem)) { throw new Error( `The only valid memory allocation values are: ${VALID_MEMORY_OPTIONS.join(", ")}` ); diff --git a/src/v1/function-configuration.ts b/src/v1/function-configuration.ts index cbaef9803..bb5e07f8f 100644 --- a/src/v1/function-configuration.ts +++ b/src/v1/function-configuration.ts @@ -178,11 +178,11 @@ export interface RuntimeOptions { /** * Amount of memory to allocate to the function. */ - memory?: typeof VALID_MEMORY_OPTIONS[number] | ResetValue; + memory?: typeof VALID_MEMORY_OPTIONS[number] | Expression | ResetValue; /** * Timeout for the function in seconds, possible values are 0 to 540. */ - timeoutSeconds?: number | ResetValue; + timeoutSeconds?: number | Expression | ResetValue; /** * Min number of actual instances to be running at a given time. @@ -191,12 +191,12 @@ export interface RuntimeOptions { * Instances will be billed for memory allocation and 10% of CPU allocation * while idle. */ - minInstances?: number | ResetValue; + minInstances?: number | Expression | ResetValue; /** * Max number of actual instances allowed to be running in parallel. */ - maxInstances?: number | ResetValue; + maxInstances?: number | Expression | ResetValue; /** * Connect cloud function to specified VPC connector.