Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Associate Cloud Engineer practice bank has an additional 2,014 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
Your company has deployed a serverless function to Google Cloud that must process data asynchronously whenever messages are published to a specific Cloud Pub/Sub topic.
You have already deployed the function code using the gcloud run deploy command. You now need to configure the event trigger using the gcloud CLI so that published Pub/Sub messages automatically invoke your deployed function.
Which command should you execute to configure this event trigger?
gcloud logging sinks create to route topic messages directly to the function's HTTP endpoint URLA Cloud Logging sink is a configuration mechanism used to capture, filter, and route Google Cloud log entries (such as Cloud Audit Logs) to external destinations like Cloud Storage buckets, BigQuery datasets, or Pub/Sub topics.
The requirement was to trigger a function whenever a specific administrative action or system audit event occurred across Google Cloud services.
gcloud eventarc triggers create with --event-filters="type=google.cloud.pubsub.topic.v1.messagePublished", --transport-topic, and --destination-run-serviceEventarc is a fully managed eventing service on Google Cloud that enables you to build event-driven architectures by decoupling event producers from event consumers. It captures events from various Google Cloud services (such as Cloud Pub/Sub, Cloud Storage, and Cloud Audit Logs) and securely routes them to destination compute platforms like Cloud Run and Cloud Functions.
gcloud eventarc triggers create creates an active subscription route between the event source and destination.--event-filters="type=google.cloud.pubsub.topic.v1.messagePublished" flag instructs Eventarc to capture message publishing events specifically.--transport-topic argument identifies the specific Pub/Sub topic that acts as the trigger source.--destination-run-service parameter directs incoming event invocations directly to the deployed serverless function.
Using Eventarc with specific event filters and transport topics is the Google Cloud standard for configuring event-driven triggers. It eliminates custom polling loops, manages backpressure, and guarantees automated execution whenever new events arrive.
Continuous polling involves writing application logic that continuously issues pull requests across a network to check whether new messages have arrived on a queue or topic.
The application was running as a long-lived daemon service on a dedicated Compute Engine VM or Google Kubernetes Engine (GKE) pod using high-throughput manual pull subscribers.
gcloud functions call specifying the function name and passing the Pub/Sub topic name in the --data argumentgcloud functions call IsThe gcloud functions call command is a development utility designed to perform direct, manual invocations of deployed functions for local testing and debugging purposes.
--data flag.A developer needed to quickly test a function's response to a simulated Pub/Sub JSON payload directly from the command-line interface without publishing real messages to a topic.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated