https.HttpsOptions interface

Options that can be set on an onRequest HTTPS function.

Signature:

exportinterfaceHttpsOptionsextendsOmit<GlobalOptions,"region"|"enforceAppCheck">

Extends: Omit<GlobalOptions, "region" | "enforceAppCheck">

Properties

PropertyTypeDescription
concurrencynumber | Expression<number> | ResetValueNumber of requests a function can serve at once.
corsstring | boolean | RegExp | Array<string | RegExp>If true, allows CORS on requests to this function. If this is a string or RegExp, allows requests from domains that match the provided value. If this is an Array, allows requests from domains matching at least one entry of the array. Defaults to true for https.CallableFunction and false otherwise.
cpunumber | "gcf_gen1"Fractional number of CPUs to allocate to a function.
ingressSettingsoptions.IngressSetting | ResetValueIngress settings which control where this function can be called from.
invoker"public" | "private" | string | string[]Invoker to set access control on https functions.
labelsRecord<string, string>User labels to set on the function.
maxInstancesnumber | Expression<number> | ResetValueMax number of instances to be running in parallel.
memoryoptions.MemoryOption | Expression<number> | ResetValueAmount of memory to allocate to a function.
minInstancesnumber | Expression<number> | ResetValueMin number of actual instances to be running at a given time.
omitboolean | Expression<boolean>If true, do not deploy or emulate this function.
regionSupportedRegion | string | Array<SupportedRegion | string> | Expression<string> | ResetValueHTTP functions can override global options and can specify multiple regions to deploy to.
secrets(string | SecretParam)[]
serviceAccountstring | Expression<string> | ResetValueSpecific service account for the function to run as.
timeoutSecondsnumber | Expression<number> | ResetValueTimeout for the function in seconds, possible values are 0 to 540. HTTPS functions can specify a higher timeout.
vpcConnectorstring | Expression<string> | ResetValueConnect cloud function to specified VPC connector.
vpcConnectorEgressSettingsoptions.VpcEgressSetting | ResetValueEgress settings for VPC connector.

https.HttpsOptions.concurrency

Number of requests a function can serve at once.

Can only be applied to functions running on Cloud Functions v2. A value of null restores the default concurrency (80 when CPU >= 1, 1 otherwise). Concurrency cannot be set to any value other than 1 if cpu is less than 1. The maximum value for concurrency is 1,000.

Signature:

concurrency?:number|Expression<number>|ResetValue;

https.HttpsOptions.cors

If true, allows CORS on requests to this function. If this is a string or RegExp, allows requests from domains that match the provided value. If this is an Array, allows requests from domains matching at least one entry of the array. Defaults to true for https.CallableFunction and false otherwise.

Signature:

cors?:string|boolean|RegExp|Array<string|RegExp>;

https.HttpsOptions.cpu

Fractional number of CPUs to allocate to a function.

Defaults to 1 for functions with <= 2GB RAM and increases for larger memory sizes. This is different from the defaults when using the gcloud utility and is different from the fixed amount assigned in Google Cloud Functions generation 1. To revert to the CPU amounts used in gcloud or in Cloud Functions generation 1, set this to the value "gcf_gen1"

Signature:

cpu?:number|"gcf_gen1";

https.HttpsOptions.ingressSettings

Ingress settings which control where this function can be called from.

Signature:

ingressSettings?:options.IngressSetting|ResetValue;

https.HttpsOptions.invoker

Invoker to set access control on https functions.

Signature:

invoker?:"public"|"private"|string|string[];

https.HttpsOptions.labels

User labels to set on the function.

Signature:

labels?:Record<string,string>;

https.HttpsOptions.maxInstances

Max number of instances to be running in parallel.

Signature:

maxInstances?:number|Expression<number>|ResetValue;

https.HttpsOptions.memory

Amount of memory to allocate to a function.

Signature:

memory?:options.MemoryOption|Expression<number>|ResetValue;

https.HttpsOptions.minInstances

Min number of actual instances to be running at a given time.

Instances will be billed for memory allocation and 10% of CPU allocation while idle.

Signature:

minInstances?:number|Expression<number>|ResetValue;

https.HttpsOptions.omit

If true, do not deploy or emulate this function.

Signature:

omit?:boolean|Expression<boolean>;

https.HttpsOptions.region

HTTP functions can override global options and can specify multiple regions to deploy to.

Signature:

region?:SupportedRegion|string|Array<SupportedRegion|string>|Expression<string>|ResetValue;

https.HttpsOptions.secrets

Signature:

secrets?:(string|SecretParam)[];

https.HttpsOptions.serviceAccount

Specific service account for the function to run as.

Signature:

serviceAccount?:string|Expression<string>|ResetValue;

https.HttpsOptions.timeoutSeconds

Timeout for the function in seconds, possible values are 0 to 540. HTTPS functions can specify a higher timeout.

The minimum timeout for a gen 2 function is 1s. The maximum timeout for a function depends on the type of function: Event handling functions have a maximum timeout of 540s (9 minutes). HTTPS and callable functions have a maximum timeout of 3,600s (1 hour). Task queue functions have a maximum timeout of 1,800s (30 minutes)

Signature:

timeoutSeconds?:number|Expression<number>|ResetValue;

https.HttpsOptions.vpcConnector

Connect cloud function to specified VPC connector.

Signature:

vpcConnector?:string|Expression<string>|ResetValue;

https.HttpsOptions.vpcConnectorEgressSettings

Egress settings for VPC connector.

Signature:

vpcConnectorEgressSettings?:options.VpcEgressSetting|ResetValue;