Google Associate Cloud Engineer exam dumps

Google Associate Cloud Engineer practice question 374 of 375

Associate Cloud Engineer. Free level, Google Cloud. Free question with the correct answer and a full explanation.

Google Associate Cloud Engineer Question 374

Select 2Google Cloud Platform

As a Google Cloud Associate Cloud Engineer, you need to generate short-lived credentials for a service account to allow a third-party application to access resources temporarily. Which of the following steps should you take to achieve this?

  1. A

    Use the 'gcloud iam service-accounts' command to create a new service account key file.

  2. B

    Utilize the 'gcloud auth application-default login' command to generate temporary credentials.

  3. C

    Create an OAuth 2.0 access token using the service account's private key.

  4. D

    Use the 'gcloud iam service-accounts keys create' command to generate a JSON key file.

  5. E

    Leverage the 'gcloud auth print-access-token' command to obtain a short-lived access token.

Show answer and explanation

Correct answers: C, E

Explanation

To generate short-lived credentials for a service account, you can create an OAuth 2.0 access token using the service account's private key and leverage the 'gcloud auth print-access-token' command to obtain a short-lived access token. These tokens are temporary and suitable for granting limited-time access to resources.

  • A. Incorrect.

    Creating a new service account key file doesn't create short-lived credentials; it creates long-lived credentials.

  • B. Incorrect.

    'gcloud auth application-default login' is used for user authentication, not for service accounts.

  • C. Correct.

    Creating an OAuth 2.0 access token using the service account's private key is a valid method to generate short-lived credentials.

  • D. Incorrect.

    Generating a JSON key file with 'gcloud iam service-accounts keys create' results in long-lived credentials.

  • E. Correct.

    The 'gcloud auth print-access-token' command can be used to obtain a short-lived access token for a service account.

Timed practice exam

Take a Google Associate Cloud Engineer practice test under exam conditions

60 questions in 120 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam