Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam Professional Cloud Developer All Questions

View all questions & answers for the Professional Cloud Developer exam

Exam Professional Cloud Developer topic 1 question 200 discussion

Actual exam question from Google's Professional Cloud Developer
Question #: 200
Topic #: 1
[All Professional Cloud Developer Questions]

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.
  • 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.
  • 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.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Underverse
Highly Voted 1 year, 11 months ago
Selected Answer: B
A&D assume that you download and store SA keys, which violates best practices, since you potentially loose control over what happens to those credentials and makes it impossible to track who actually uses the SA. D makes it even worse since it requires you to maintain you own secret management to minimize the risk. C does nothing that would give you the SA permissions you need. B follows best practices, since impersonation permissions can be managed transparently via IAM and via logs you can also see who impersonated/used the SA.
upvoted 5 times
...
mrgarfield
Most Recent 2 months, 2 weeks ago
Selected Answer: C
Application Default Credentials (ADC): gcloud auth application-default login sets up the Application Default Credentials (ADC) which are a secure way to authenticate applications running on Google Cloud. Minimal Permissions: Your Cloud Identity already has the necessary permissions (roles/iam.serviceAccountTokenCreator) to create service account tokens and the required permissions to deploy resources using Terraform. Security Best Practices: Using ADC avoids storing the service account key file locally on your laptop, which minimizes the risk of exposure and adheres to security best practices.
upvoted 1 times
...
alpha_canary
7 months, 2 weeks ago
Selected Answer: B
https://cloud.google.com/docs/authentication/use-service-account-impersonation https://medium.com/bluetuple-ai/terraform-remote-state-on-gcp-d50e2f69b967
upvoted 1 times
...
namanj71
8 months, 1 week ago
B is the correct Answer
upvoted 1 times
...
__rajan__
1 year, 2 months ago
Selected Answer: B
B is correct.
upvoted 1 times
...
purushi
1 year, 3 months ago
Selected Answer: B
B is the best option here. D is more complicated. A & C do not follow google best practices.
upvoted 1 times
...
closer89
1 year, 7 months ago
Selected Answer: B
B 1. impersonation 2. securely set up env variable that will be used by terraform to deploy
upvoted 1 times
...
saketmurari
1 year, 7 months ago
I think its A
upvoted 1 times
...
telp
1 year, 10 months ago
Selected Answer: B
Answer is B https://cloud.google.com/sdk/gcloud/reference/config/set#impersonate_service_account
upvoted 1 times
...
TNT87
1 year, 10 months ago
Selected Answer: B
https://cloud.google.com/blog/topics/developers-practitioners/using-google-cloud-service-account-impersonation-your-terraform-code Answer B not D
upvoted 4 times
...
TNT87
1 year, 11 months ago
https://cloud.google.com/docs/terraform/best-practices-for-terraform#default-credhttps://cloud.google.com/docs/terraform/best-practices-for-terraform#storing-secrets Answer D.
upvoted 1 times
TNT87
1 year, 10 months ago
Answer B not D
upvoted 1 times
...
...
micoams
1 year, 11 months ago
Selected Answer: B
I think it's option B. The question already says that you have the role for impersonating the service account. This means that option B is a viable, as you can impersonate that service account, and get a token that has the required level of access to create resources.
upvoted 2 times
...
zellck
1 year, 11 months ago
Selected Answer: D
D is the answer. 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.
upvoted 1 times
TNT87
1 year, 10 months ago
Answer B not D
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...