Preparing Practice Exam…
Please wait a moment while the system generates the exam questions, answers, and study session.
Please wait a moment while the system generates the exam questions, answers, and study session.
Google Cloud Certified Professional Cloud Developer · Google Cloud
Select one answer.
Written by other learners. Comments can disagree with the marked answer — check the official documentation when in doubt.
I would go with B.
Option B is the correct answer because it involves creating a service account in project A and adding it as a publisher to the Cloud Pub/Sub topic in project B. This allows the Compute Engine instances in project A to authenticate to the Cloud Pub/Sub topic in project B using the service account's credentials. The other options do not involve creating a service account in project A or adding it as a publisher to the Cloud Pub/Sub topic in project B, so they are not valid solutions.
Option D is incorrect because it does not authenticate to the Cloud Pub/Sub topic in project B. In this option, Application Default Credentials are being used to authenticate to the topic, but the private key of a service account owned by project A is being used. This service account does not have the necessary permissions to publish messages to the topic in project B.