0
0
GCPcloud~10 mins

Cloud Functions generations (1st vs 2nd) in GCP - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the generation of the Cloud Function.

GCP
gcloud functions deploy my-function --runtime python39 --trigger-http --gen [1]
Drag options to blanks, or click blank then click option'
A1
B2
C3
Dlatest
Attempts:
3 left
💡 Hint
Common Mistakes
Using '1' instead of '2' for the generation flag.
Using 'latest' which is not a valid generation option.
2fill in blank
medium

Complete the code to set the region for a 2nd generation Cloud Function.

GCP
gcloud functions deploy my-function --runtime nodejs18 --trigger-http --gen 2 --region [1]
Drag options to blanks, or click blank then click option'
Aeurope-west1
Bglobal
Cus-east1
Dus-central1
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'global' which is not supported for 2nd gen functions.
Choosing a region not supported by Cloud Functions.
3fill in blank
hard

Fix the error in the deployment command for a 1st generation Cloud Function.

GCP
gcloud functions deploy my-function --runtime python39 --trigger-http --gen [1] --region us-central1
Drag options to blanks, or click blank then click option'
A1
B3
C2
Dnone
Attempts:
3 left
💡 Hint
Common Mistakes
Using '--gen 2' for a first generation function.
Omitting the generation flag when required.
4fill in blank
hard

Fill both blanks to configure a 2nd generation Cloud Function with memory and timeout.

GCP
gcloud functions deploy my-function --runtime go120 --trigger-http --gen 2 --memory [1] --timeout [2]
Drag options to blanks, or click blank then click option'
A512MB
B60s
C128MB
D540s
Attempts:
3 left
💡 Hint
Common Mistakes
Using too low memory like 128MB for heavier workloads.
Setting timeout too high or without 's' suffix.
5fill in blank
hard

Fill all three blanks to create a 2nd generation Cloud Function with environment variables and service account.

GCP
gcloud functions deploy my-function --runtime nodejs18 --trigger-http --gen 2 --set-env-vars [1] --service-account [2] --region [3]
Drag options to blanks, or click blank then click option'
AENV=prod,DEBUG=false
Bmy-service-account@project.iam.gserviceaccount.com
Cus-central1
DENV=dev,DEBUG=true
Attempts:
3 left
💡 Hint
Common Mistakes
Using invalid environment variable format.
Using a wrong or missing service account.
Choosing an unsupported region.