Google Cloud Professional Cloud Developer — Question 320

Your infrastructure team uses Terraform Cloud and manages Google Cloud resources by using Terraform configuration files. You want to configure an infrastructure as code pipeline that authenticates to Google Cloud APIs. You want to use the most secure approach and minimize changes to the configuration. How should you configure the authentication?

Answer options

Correct answer: C

Explanation

The correct answer is C because configuring Terraform Cloud to utilize workload identity federation allows for secure authentication without the need for service account keys, reducing the risk of key exposure. Option A is incorrect since it involves using GKE and Kubernetes service accounts, which is not the most straightforward method for Terraform Cloud. Option B suggests using a Compute Engine VM, which complicates the setup and is less secure. Option D, while functional, involves handling service account keys, which is less secure than workload identity federation.