Interview Prep/Real-World Interview/Multi-env and multi-account

Resources across accounts have inconsistent names and missing tags. How do you enforce standards?

BeginnerScenarioMulti-env and multi-account
Answer

Situation read → Tags drive cost allocation, ownership and automation. Enforcement has to happen at creation time, plus a cleanup of what exists.

What I'd do →

  1. Define a small required set: team, env, service, cost-center.
  2. Apply them by default in Terraform:
provider "aws" {
  default_tags {
    tags = { team = "payments", env = "prod", service = "checkout", managed-by = "terraform" }
  }
}
  1. Enforce: AWS Organizations tag policies for allowed values, and SCP conditions requiring tags on key create actions.
  2. CI check: Checkov or a custom OPA policy fails PRs missing required tags.
  3. Backfill existing resources and report untagged spend monthly.

Why → default_tags makes compliance automatic for everything Terraform creates.

Interview tip → Mention default_tags; it's the lowest-effort, highest-impact step.

All Real-World Interview questions Roadmap: Interview readiness

More on Multi-env and multi-account