Practical infrastructure challenge

CI/CD Pipeline Engineering Challenge

Design a controlled Terraform delivery pipeline with saved plan review, artifact integrity, approval gates, temporary credentials and reproducible validation.

1. Inspect the delivery workflow

Controlled infrastructure release

A platform team needs to deliver a release without allowing unreviewed changes. The pipeline must validate source, save and inspect a plan, bind approval to the exact artifact and target, and stop if integrity or policy checks fail. Deployment credentials must be scoped to the authorized job.

  1. Format and validate source
  2. Create saved plan for reviewed revision and target
  3. Inspect plan and run policy checks
  4. Obtain independent approval of the exact artifact and target
  5. Verify approved artifact identity and deployment prerequisites
  6. Release only through an authorized deployment job

The exercise is local and synthetic. No cloud account is needed.

Inspect the scenario data
{
  "workload": "Synthetic release metadata",
  "pipeline": [
    "Format and validate source",
    "Create saved plan for reviewed revision and target",
    "Inspect plan and run policy checks",
    "Obtain independent approval of the exact artifact and target",
    "Verify approved artifact identity and deployment prerequisites",
    "Release only through an authorized deployment job"
  ],
  "requirements": [
    "Pin the tested Terraform version and preserve dependency selections",
    "Keep plan artifacts restricted",
    "Use temporary workload identity where supported",
    "Reject changed artifacts and require fresh review when context changes"
  ],
  "exercise": "No apply operation; the example uses only Terraform's built-in terraform_data resource."
}

2. Evaluate the pipeline

Loading the practice questions...

3. Construct a reproducible release fixture

Write main.tf for a local pipeline rehearsal. Require Terraform 1.12.2 for this specific exercise. Declare a string variable named release_id with default catalog-v1, create a built-in terraform_data resource named release using that value as its input, and expose the same value as the release_id output. This is a fixture for generating a saved plan, not an instruction to deploy infrastructure.

main.tfTerraform ยท HCL
Need a conceptual hint?

Use a terraform block for the version constraint, a typed input variable, one terraform_data resource and an output. This fixture requires no external provider.

Compare a reference example after attempting
terraform {
  required_version = "= 1.12.2"
}

variable "release_id" {
  type    = string
  default = "catalog-v1"
}

resource "terraform_data" "release" {
  input = var.release_id
}

output "release_id" {
  value = var.release_id
}

Compare the version, input, resource name and output. The browser editor supports HCL self-comparison rather than native Terraform execution.

4. Design the release gate

Explain why a digest must be bound to a trusted approval record, why that record must identify the target and reviewed revision, and why matching a digest does not itself establish authorization. Describe how to prevent concurrent state changes, protect plan artifacts and handle a failed policy check. A real saved-plan deployment requires separate authorization; passing a saved plan to Terraform apply does not prompt for confirmation.

Continue your learning

Explore Plan Review Challenge, Infrastructure Security and IAM Challenge, Module Design Challenge and learning methodology.

Technical references