Bird
0
0

You have a Cloud Function written in Python 3.9 but want to upgrade to Python 3.11 runtime. What is the best approach to update the runtime without changing your code?

hard📝 Best Practice Q15 of 15
GCP - Cloud Functions
You have a Cloud Function written in Python 3.9 but want to upgrade to Python 3.11 runtime. What is the best approach to update the runtime without changing your code?
ARedeploy the function using <code>--runtime python311</code> flag
BEdit the function code to specify Python 3.11 version
CChange the memory allocation to trigger runtime update
DUpdate the billing account to enable Python 3.11
Step-by-Step Solution
Solution:
  1. Step 1: Understand how to change runtime version

    Runtime is set during deployment using the --runtime flag; code changes are not needed for version upgrade.
  2. Step 2: Identify the correct deployment command

    Redeploying with --runtime python311 updates the runtime environment to Python 3.11.
  3. Final Answer:

    Redeploy the function using --runtime python311 flag -> Option A
  4. Quick Check:

    Use --runtime flag to upgrade runtime version [OK]
Quick Trick: Redeploy with new --runtime flag to upgrade version [OK]
Common Mistakes:
  • Editing code to change runtime version
  • Changing memory or billing unrelated to runtime
  • Assuming runtime upgrades automatically

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GCP Quizzes