medium severitygcloud functions deploy, Cloud Functions Gen2

Deployment fails with: `ERROR: ... Could not create Cloud Run service. spec.template.spec.containers.resources.limits.memory: Invalid value specified for memory. For the specified value, maxScale may not exceed 83.`

Root cause

In GCP Cloud Functions Gen2 (built on Cloud Run), instance scaling (maxScale/max-instances) is constrained by allocated memory/CPU per instance. Low/default memory (~256MiB) limits max-instances to ~83; higher max-instances from prior Gen1 config or defaults violates this during deployment/migration, causing validation failure before runtime scaling issues occur.

GCPCloud FunctionsGen2Cloud Runmax-instancesmemory limitmaxScaledeployment errorconcurrencyscaling

Citations