Wire child defaults and aliases to their required configurations

A hands-on TERRAFORM-004 lab. You produce the real artefact and 9 automated checks verify it behaves the way the exam expects.

Try this labAll TERRAFORM-004 practice

Certification
TERRAFORM-004
Format
Structured configuration
Difficulty
medium
Estimated time
20 min
Automated checks
9

The brief

Repair providers.tf.json, which contains the service and audit module calls. Keep their sources ./modules/service and ./modules/audit. Read the supplied child interfaces: service declares terraform.io/builtin/terraform locally as terraform and requires configuration_aliases = [terraform.replica]; terraform_data.primary uses its default configuration, and terraform_data.replica explicitly uses terraform.replica. Audit declares the same source and its terraform_data.audit uses its default configuration. Caller configuration purposes are: terraform and terraform.primary serve primary; terraform.replica serves replica; terraform.audit serves audit. Keep exactly these two module calls and route every child resource to a configuration serving its required purpose. The required service alias must be passed explicitly. In Terraform JSON the providers map uses child-scoped names as keys and static caller configuration references as string values, for example terraform.replica as a key and terraform.replica as its caller reference. You may explicitly map service's default to terraform.primary, or let service inherit the caller's default while supplying its required replica alias. Audit must explicitly receive terraform.audit. Inspect resourceBindings, missingAliases and mappingErrors after Run tests. The caller configurations and child resource declarations are read-only. The bounded artifact supports only module source and static providers maps; variables, arbitrary expressions, inline provider blocks and additional module arguments are outside this exercise. Repair through normal edits without Reset.

What the checks verify

Your work is graded on 9 independent properties, not on matching one reference answer.

  • The artifact uses the bounded Terraform JSON module and providers structure.
  • Exactly the supplied service and audit module calls remain.
  • Service retains its supplied source and declared provider interface.
  • Audit retains its supplied source and declared provider interface.
  • Mapped child names and caller references resolve to compatible declared provider sources.
  • Service's required terraform.replica alias is explicitly supplied.
  • The primary child object uses a configuration serving the primary purpose.
  • The replica child object uses the caller's replica configuration.
  • The separately owned audit child object uses the audit configuration.

Where this sits in the TERRAFORM-004 blueprint

Domain
Terraform modules
Objective
Module Composition
Skill
Scope and Provider Wiring

Part of TERRAFORM-004 preparation

Labs are written by ExamNova to teach the decisions the exam tests. They are not reproductions of vendor lab content.