Skip to content

Support runtime API to update minInstances for Firebase Functions v2 #1710

@mcoevert

Description

@mcoevert

Firebase Functions v2 allows us to set minInstances via runWith() or firebase.json at deploy time. However, there is currently no way to update this value programmatically at runtime (e.g. via REST API or Admin SDK).

Use case:
We want to scale a function up or down (e.g. from 0 to 5 min instances) based on time or usage pattern.
For example:
• Increase minInstances at 8:00am before peak hours
• Reduce minInstances back to 0 at 8:00pm to save costs

This kind of time-based or traffic-driven scaling works great in Cloud Run (via Admin API PATCH), but fails on Firebase Functions v2 because the underlying Cloud Run service is not modifiable via API (returns 404).

Proposal:
Expose a way (via Firebase Admin SDK or REST API) to update minInstances on deployed Functions v2 services without requiring a full firebase deploy.

Why it matters:
• It avoids unnecessary redeploys
• Allows dynamic cost-saving patterns
• Fits the modern serverless scaling expectations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions