Home > Enterprise >  Firebase CLI - Suppress User Prompts
Firebase CLI - Suppress User Prompts

Time:11-11

I am deploying a function via firebase-cli with a minInstances param as per documentation. This works, however there is now a user prompt to acknowledge the estimated costs:

i  functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i  functions: ensuring required API cloudbuild.googleapis.com is enabled...
✔  functions: required API cloudfunctions.googleapis.com is enabled
✔  functions: required API cloudbuild.googleapis.com is enabled
i  functions: preparing . directory for uploading...
i  functions: packaged . (230.66 KB) for uploading
⚠  functions: The following functions have reserved minimum instances. This will reduce the frequency of cold starts but increases the minimum cost. You will be charged for the memory allocation and a fraction of the CPU allocation of instances while they are idle.

    testFunctionInstances(us-central1): 2 instances, 1GB of memory each

With these options, your minimum bill will be $17.22 in a 30-day month
? Would you like to proceed with deployment? (y/N) 

This new prompt is breaking our current deployment setup. We're currently looking at using firebase-cli to deploy functions in a "vanilla" state ie no additional runtime parameters, and then following up with gcloud beta to update a discrete list of existing functions with new runtime params; however, this adds new complexity to our CI/CD.

Is there a way to suppress these kinds of messages associated with financial estimates?

CodePudding user response:

The warning in question only appears when the estimated price is going up - after a single manual deploy if minInstances remains stable there will not be a prompt.

That being said, you can add the --force flag to the deploy which will suppress all prompting. Note that this includes prompting to delete functions missing from the deployment, so be careful when removing functions.

  • Related