0
0
GCPcloud~10 mins

Eventarc for event routing in GCP - Interactive Code Practice

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

Complete the code to create an Eventarc trigger that listens to Cloud Storage events.

GCP
gcloud eventarc triggers create my-trigger --destination-run-service=my-service --destination-run-region=us-central1 --event-filters=type=[1]
Drag options to blanks, or click blank then click option'
Agoogle.cloud.scheduler.job.v1.executed
Bgoogle.cloud.storage.object.v1.finalized
Cgoogle.cloud.pubsub.topic.v1.messagePublished
Dgoogle.cloud.firestore.document.v1.written
Attempts:
3 left
💡 Hint
Common Mistakes
Using Pub/Sub or Firestore event types instead of Cloud Storage event types.
Confusing event type names with service names.
2fill in blank
medium

Complete the command to specify the region where the Eventarc trigger will be created.

GCP
gcloud eventarc triggers create my-trigger --destination-run-service=my-service --destination-run-region=[1] --event-filters=type=google.cloud.storage.object.v1.finalized
Drag options to blanks, or click blank then click option'
Aeurope-west1
Basia-east1
Cus-central1
Dsouthamerica-east1
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a region where Cloud Run or Eventarc is not supported.
Using a region that does not match the Cloud Run service location.
3fill in blank
hard

Fix the error in the Eventarc trigger creation command by selecting the correct flag for the destination service.

GCP
gcloud eventarc triggers create my-trigger --destination-run-service=[1] --destination-run-region=us-central1 --event-filters=type=google.cloud.storage.object.v1.finalized
Drag options to blanks, or click blank then click option'
Amy-service
Bmy-service-run
Cmy-service-cloudrun
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong flag name for the destination service.
Adding extra suffixes to the service name.
4fill in blank
hard

Fill both blanks to create an Eventarc trigger that listens to Pub/Sub topic messages and routes them to a Cloud Run service.

GCP
gcloud eventarc triggers create pubsub-trigger --destination-run-service=[1] --destination-run-region=[2] --event-filters=type=[3] --event-filters=source=//pubsub.googleapis.com/projects/my-project/topics/my-topic
Drag options to blanks, or click blank then click option'
Amy-pubsub-service
Bus-east1
Cgoogle.cloud.pubsub.topic.v1.messagePublished
Deurope-west1
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing event types for different services.
Using incorrect region or service names.
5fill in blank
hard

Fill all three blanks to define an Eventarc trigger in YAML that routes Firestore document changes to a Cloud Run service.

GCP
apiVersion: eventarc.googleapis.com/v1
kind: Trigger
metadata:
  name: firestore-trigger
spec:
  destination:
    cloudRunService: [1]
    region: [2]
  eventFilters:
  - attribute: type
    value: [3]
Drag options to blanks, or click blank then click option'
Afirestore-service
Bus-west1
Cgoogle.cloud.firestore.document.v1.written
Dus-central1
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong event filter values.
Mixing up region names.
Incorrect service names.