Google Cloud Associate Cloud Engineer — Question 49

You want to send and consume Cloud Pub/Sub messages from your App Engine application. The Cloud Pub/Sub API is currently disabled. You will use a service account to authenticate your application to the API. You want to make sure your application can use Cloud Pub/Sub. What should you do?

Answer options

Correct answer: A

Explanation

The correct answer is A because enabling the Cloud Pub/Sub API in the API Library is essential for your application to communicate with the service. Option B is incorrect as the API will not automatically enable itself without prior action. Option C incorrectly assumes that all APIs are automatically enabled upon deployment, which is not the case. Option D suggests enabling the API during the first connection, which will not work if the API is disabled initially.