A renewable energy analytics firm recently completed a rapid lift-and-shift migration of its IoT data processing pipeline to Google Cloud. A post-migration architecture audit identified two critical sources of technical debt: infrastructure engineers store Terraform state files on local developer workstations, resulting in frequent state drift and race conditions during deployments; additionally, compute workloads execute using service accounts assigned the project-level Owner primitive role to simplify access to Cloud Storage and BigQuery. Which combination of architectural refactoring actions should you recommend to effectively mitigate this technical debt while adhering to Google Cloud recommended practices?
- Migrate the Terraform state files to a centralized Cloud Storage bucket configured with Object Versioning and state locking, and replace the project-level Owner roles with minimal predefined IAM roles assigned directly to workload service accounts.Cevap
- BCommit all local Terraform state files directly into a version-controlled Git repository, and replace project-level Owner roles with minimal predefined IAM roles assigned directly to workload service accounts.
- CMigrate the Terraform state files to a centralized Cloud Storage bucket configured with Object Versioning and state locking, but maintain project-level Owner primitive roles while relying on VPC Service Controls to prevent unauthorized resource access.
- DRefactor all compute workloads to run inside Google Kubernetes Engine (GKE) clusters using Workload Identity, while migrating Terraform state management to a dedicated Cloud Spanner instance.
Cevap
The optimal mitigation strategy is to migrate Terraform state files to a Cloud Storage backend with Object Versioning and state locking, while replacing primitive Owner roles with least-privilege predefined IAM roles.
The correct recommendation addresses both identified areas of technical debt according to Google Cloud architectural best practices. Configuring Cloud Storage as a remote backend provides central state storage, object versioning for rollback capabilities, and native state locking to prevent concurrent modifications. Concurrently, replacing primitive Owner roles with targeted predefined roles (such as Cloud Storage Object Admin or BigQuery Data Editor) enforces least privilege and meets compliance standards without introducing operational complexity.
Adım Adım Çözüm
Anahtar Kavram
Technical Debt Mitigation in IaC State Management and IAM Role Scoping