Skip to content

Quiz — Dependencies, Modules, Multi-Repo & CI/CD Security

Quiz results are saved to your browser's local storage and will persist between sessions.

The dependency graph (depends_on vs implicit edges), module encapsulation and refactoring, archive_file vs local-exec, Consul KV vs terraform_remote_state, root blast-radius boundaries, and GitOps CI/CD security. Reference: §4 Dependencies & Graph, §8 Modules & Escape Hatches, and §10 Production Architecture.

12 questions. Back to all topics

#

In a multi-repo Terraform setup using Consul KV instead of terraform_remote_state for cross-repo data sharing, what's the main advantage of the Consul approach?

#

In a dependency chain repo-A → repo-B → repo-C (each publishing data the next consumes via Consul), repo-C fails with an 'Invalid index' error trying to read a key that's supposed to come from repo-A. What's the most likely root cause?

#

Two data "consul_keys" blocks live side by side in the same file. One's path is parameterized by environment (${local.env_key}); the other is hardcoded to end in /default. The hardcoded one starts failing with an empty-string read. What's the most likely explanation?

#

Two separate Terraform repos both try to create a google_secret_manager_secret_iam_member granting the same access — one references the other repo's service-account email via cross-repo data, the other only needs data it already has locally. Which one should actually own the grant?

#

A local Consul dev agent (consul agent -dev, in-memory only) still has old KV data describing a service account, even though that service account's Terraform state was fully destroyed and rebuilt from scratch. Why?

#

A real production Consul deployment and the consul agent -dev used in this sandbox both work with identical Terraform HCL. What's actually different between them?

#

A google_project_iam_member resource sets member = "serviceAccount:${google_service_account.gsa.email}". Should you also add depends_on = [google_service_account.gsa] to that block, and when IS depends_on genuinely needed?

#

You extract an existing root resource resource "google_service_account" "gsa" into a reusable child module module "backend_sa" { source = "./modules/service_account" } (where the resource is named this). What happens on the next terraform plan if you do nothing else?

#

Both data "archive_file" and null_resource with provisioner "local-exec" step outside standard cloud resource APIs. Why is data "archive_file" considered an idiomatic declarative pattern while local-exec is treated as a last-resort code smell?

#

In a GitOps CI/CD pipeline where terraform plan runs automatically on every pull request using a service account with state-read access, how can a malicious PR exfiltrate production secrets even if runner internet egress is blocked and CI secret masking is enabled?

#

Why do most production multi-environment Terraform architectures prefer separate directories/backend prefixes (envs/dev/, envs/prod/) over CLI workspaces (terraform workspace select prod)?

#

Which of the following is the strongest architectural signal that a single Terraform root module should be split into multiple independent roots?

Quiz Progress

0 / 0 questions answered (0%)

0 correct