Google Associate Cloud Engineer exam dumps

Google Associate Cloud Engineer practice question 370 of 375

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

Google Associate Cloud Engineer Question 370

Select 2Google Cloud Platform

You are a Google Cloud Engineer tasked with creating short-lived service account credentials for a deployment script that runs on a Compute Engine instance. Which of the following steps should you take to generate these credentials using the Google Cloud SDK?

  1. A

    Use the 'gcloud auth activate-service-account' command with the key file.

  2. B

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

  3. C

    Set an environment variable GOOGLE_APPLICATION_CREDENTIALS with the path to the JSON key file.

  4. D

    Use the 'gcloud auth application-default login' command to authenticate the script.

  5. E

    Use the 'gcloud compute instances create' command with a service account email.

Show answer and explanation

Correct answers: B, C

Explanation

To manage short-lived service account credentials, you need to generate a new key for the service account using 'gcloud iam service-accounts keys create'. Once the key is downloaded, set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the path of the key file to ensure your application uses these credentials. These steps allow your script to authenticate using the temporary credentials provided by the service account key.

  • A. Incorrect.

    This command is used to activate a service account with an existing key, not to create short-lived credentials.

  • B. Correct.

    This command is correct for generating a new service account key, which can be used as short-lived credentials.

  • C. Correct.

    Setting the GOOGLE_APPLICATION_CREDENTIALS environment variable is necessary to ensure your script uses the short-lived credentials.

  • D. Incorrect.

    This command is used for user credentials, not for service account credentials.

  • E. Incorrect.

    This command creates a compute instance and assigns a service account, but it does not manage service account keys.

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