Exam Professional Cloud Developer All QuestionsBrowse all questions from this exam
Question 74

Your company has created an application that uploads a report to a Cloud Storage bucket. When the report is uploaded to the bucket, you want to publish a message to a Cloud Pub/Sub topic. You want to implement a solution that will take a small amount to effort to implement.

What should you do?

    Correct Answer: A

    To achieve the desired functionality with minimal effort, the most appropriate solution is to configure the Cloud Storage bucket to trigger Cloud Pub/Sub notifications when objects are modified (such as when the report is uploaded). This approach leverages built-in integration between Cloud Storage and Cloud Pub/Sub, eliminating the need to write and deploy additional code or infrastructure. By configuring Cloud Storage settings directly, the system can automatically send notifications to a Pub/Sub topic upon object changes, ensuring efficient and reliable message delivery.

Discussion
donchickOption: A

Since one of reqs is "You want to implement a solution that will take a small amount to effort to implement" I'd choose A because no code has to be written. However option C works great as well and is recommended by https://cloud.google.com/storage/docs/pubsub-notifications#other_notification_options.

closer89

you link says that you use cloud functions only when you dont want to publish message to pubsub

omermahgoubOption: C

C. Create a Cloud Function that is triggered by the Cloud Storage bucket. In the Cloud Function, publish a message to the Cloud Pub/Sub topic. This would be the most straightforward and easiest solution to implement, as it only requires creating a Cloud Function and setting it up to be triggered by the Cloud Storage bucket. This solution would not require deploying any additional resources, such as App Engine or a Kubernetes cluster, and would not require any significant code changes to the application uploading the report.

zevexWM

A does exactly the same just without Cloud Functions. Notifications triggered by a Cloud Storage event, work as a trigger for PubSub. No need for Cloud Functions.

zevexWM

Changing to option C. Option A state "when objects are modified" which is not the request here.

closer89

documentation says that you use cloud functions only when you dont want to publish message to pubsub. but you need to publish message to pubsub - therefore answer is A https://cloud.google.com/storage/docs/pubsub-notifications#other_notification_options https://cloud.google.com/storage/docs/pubsub-notifications#overview

StelSenOption: A

Option-A required least amount of effort to implement. https://cloud.google.com/storage/docs/reporting-changes#enabling

syu31svc

Agree; just a one line code and you're done

tomato123Option: A

I think A is correct

ParagSanyashivOption: A

Answer A takes least effort to implement the solution

mariorossiOption: C

A not is correct because trigger must to be only in insert and not modify. only C is possible

thewalkerOption: A

The best answer is A. Configure the Cloud Storage bucket to trigger Cloud Pub/Sub notifications when objects are modified. Here's why: Simplicity and Ease of Implementation: This approach is the most straightforward and requires minimal effort. Cloud Storage offers built-in integration with Cloud Pub/Sub, allowing you to configure notifications directly within the bucket settings. No Additional Code: You don't need to write any custom code or deploy additional applications. Cloud Storage handles the notification process automatically. Scalability and Reliability: Cloud Pub/Sub is a highly scalable and reliable messaging service, ensuring that your notifications are delivered efficiently and reliably.

thewalker

Let's look at why the other options are less ideal: B. Create an App Engine application to receive the file; when it is received, publish a message to the Cloud Pub/Sub topic. This approach requires you to create and deploy an App Engine application, which adds complexity and overhead. C. Create a Cloud Function that is triggered by the Cloud Storage bucket. In the Cloud Function, publish a message to the Cloud Pub/Sub topic. While Cloud Functions are a good option for event-driven tasks, this approach still requires you to write and deploy code, making it more complex than using built-in Cloud Storage notifications. D. Create an application deployed in a Google Kubernetes Engine cluster to receive the file; when it is received, publish a message to the Cloud Pub/Sub topic. This is the most complex and resource-intensive approach. It requires you to create and manage a Kubernetes cluster, deploy an application, and handle the notification process within your application code.

santoshchauhanOption: A

A. Configure the Cloud Storage bucket to trigger Cloud Pub/Sub notifications when objects are modified. This solution is straightforward and requires minimal effort to implement. Google Cloud Storage offers native support for publishing messages to Cloud Pub/Sub topics in response to changes in your bucket, like uploading a new file. By configuring Cloud Storage to automatically send a message to a Pub/Sub topic when a new report is uploaded, you can easily set up a real-time notification system without the need to write and maintain additional code.

RajanOption: A

A is correct.

cloud_enth0325Option: A

A -- Least steps for the overall requirement. Option C, tho suggested, won't need to trigger pub/sub unless it requires heavyweight or many subsequent steps. (https://cloud.google.com/storage/docs/pubsub-notifications#:~:text=don%27t%20want%20to%20manage%20a%20Pub/Sub%20topic)

brewpikeOption: C

Also, aren't cloud storage objects immutable you can't modify but version them.

brewpikeOption: A

A : https://cloud.google.com/storage/docs/pubsub-notifications