Complete the code to deploy a serverless function on Google Cloud Functions.
gcloud functions deploy myFunction --runtime [1] --trigger-http --allow-unauthenticatedThe correct runtime for deploying a Python 3.9 Google Cloud Function is python39.
Complete the code to set the memory allocation for a Cloud Function.
gcloud functions deploy myFunction --runtime python39 --memory [1] --trigger-http256MB is a common memory allocation for lightweight serverless functions balancing cost and performance.
Fix the error in the Cloud Function trigger type to respond to HTTP requests.
gcloud functions deploy myFunction --runtime python39 --trigger-[1] --allow-unauthenticatedThe correct trigger for HTTP requests is http. Other triggers are for storage buckets or messaging.
Fill both blanks to create a serverless function that scales automatically and logs output.
gcloud functions deploy myFunction --runtime python39 --trigger-http --[1] --set-env-vars LOG_LEVEL=[2]
Setting min-instances=0 allows automatic scaling to zero when idle. Setting LOG_LEVEL=INFO configures logging verbosity.
Fill all three blanks to define a serverless function with a timeout, memory, and environment variable.
gcloud functions deploy myFunction --runtime python39 --timeout=[1] --memory=[2] --set-env-vars MODE=[3]
A 120-second timeout allows longer processing. 256MB memory balances cost and performance. Setting MODE to production configures the function for live use.