ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 206 - Professional Cloud Developer discussion

Report
Export

You need to deploy resources from your laptop to Google Cloud using Terraform. Resources in your Google Cloud environment must be created using a service account. Your Cloud Identity has the roles/iam.serviceAccountTokenCreator Identity and Access Management (IAM) role and the necessary permissions to deploy the resources using Terraform. You want to set up your development environment to deploy the desired resources following Google-recommended best practices. What should you do?

A.
1) Download the service account's key file in JSON format, and store it locally on your laptop. 2) Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the path of your downloaded key file.
Answers
A.
1) Download the service account's key file in JSON format, and store it locally on your laptop. 2) Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the path of your downloaded key file.
B.
1) Run the following command from a command line: gcloud config set auth/impersonate_service_account [email protected]. 2) Set the GOOGLE_OAUTH_ACCESS_TOKEN environment variable to the value that is returned by the gcloud auth print-access-token command.
Answers
B.
1) Run the following command from a command line: gcloud config set auth/impersonate_service_account [email protected]. 2) Set the GOOGLE_OAUTH_ACCESS_TOKEN environment variable to the value that is returned by the gcloud auth print-access-token command.
C.
1) Run the following command from a command line: gcloud auth application-default login. 2) In the browser window that opens, authenticate using your personal credentials.
Answers
C.
1) Run the following command from a command line: gcloud auth application-default login. 2) In the browser window that opens, authenticate using your personal credentials.
D.
1) Store the service account's key file in JSON format in Hashicorp Vault. 2) Integrate Terraform with Vault to retrieve the key file dynamically, and authenticate to Vault using a short-lived access token.
Answers
D.
1) Store the service account's key file in JSON format in Hashicorp Vault. 2) Integrate Terraform with Vault to retrieve the key file dynamically, and authenticate to Vault using a short-lived access token.
Suggested answer: D

Explanation:

https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys#file-system

Whenever possible, avoid storing service account keys on a file system. If you can't avoid storing keys on disk, make sure to restrict access to the key file, configure file access auditing, and encrypt the underlying disk.

https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys#software-keystore

In situations where using a hardware-based key store isn't viable, use a software-based key store to manage service account keys. Similar to hardware-based options, a software-based key store lets users or applications use service account keys without revealing the private key. Software-based key store solutions can help you control key access in a fine-grained manner and can also ensure that each key access is logged.

asked 18/09/2024
Joe Mon
27 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first