QuestionQ228

Integrating applications with Google Cloud services

You are developing a Compute Engine-hosted application in project A that must securely authenticate to a Cloud Pub/Sub topic in project B.

What should you do?

  • A Configure the instances with a service account owned by project B. Add the service account as a Cloud Pub/Sub publisher to project A.
  • B Configure the instances with a service account owned by project A. Add the service account as a publisher on the topic.
  • C Configure Application Default Credentials to use the private key of a service account owned by project B. Add the service account as a Cloud Pub/Sub publisher to project A.
  • D Configure Application Default Credentials to use the private key of a service account owned by project A. Add the service account as a publisher on the topic
Explanation

A workload running on Compute Engine should use the credentials of its attached service account. Granting that project A service account the Pub/Sub Publisher role on the topic in project B authorizes it to publish cross-project without managing a private service-account key.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!