Courseiva
Use Terraform outside the core workfloweasyMultiple SelectObjective-mapped

TF-004 Use Terraform outside the core workflow Practice Question

Which TWO of the following are valid ways to use Terraform outside the core workflow? (Choose two.)

⚠ Common exam trap

HashiCorp often tests the distinction between provisioning (Terraform) and configuration management (Ansible, Chef), so candidates mistakenly think Terraform can install software or manage secrets, when it is strictly for infrastructure lifecycle and state-driven outputs.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Using Terraform outputs as inputs for other tools like Ansible.

Terraform outputs can be consumed by other tools like Ansible via the `terraform output` command or by referencing the state file, enabling integration in multi-tool workflows. Option E is correct because the Terraform state file (`.tfstate`) contains all resource attributes and dependencies, which can be parsed programmatically or with tools like `terraform graph` to generate infrastructure diagrams, extending Terraform's use beyond provisioning.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Using Terraform to manage application secrets lifecycle.

    Why it's wrong here

    Terraform's primary role is to provision and manage the lifecycle of infrastructure resources, including secret *stores* like AWS Secrets Manager or HashiCorp Vault, and can even insert initial secrets. However, it lacks native capabilities for the ongoing, dynamic aspects of secrets lifecycle management, such as automatic rotation schedules, expiration enforcement, or generating ephemeral credentials. These advanced functions are typically handled by dedicated secrets management platforms or custom automation.

  • Using Terraform outputs as inputs for other tools like Ansible.

    Why this is correct

    Terraform outputs provide a structured and machine-readable mechanism to expose specific values derived from the managed infrastructure, such as newly provisioned IP addresses, DNS names, or resource IDs. These exposed values are easily consumed by other automation tools, including configuration management systems like Ansible, custom scripts, or subsequent stages in a CI/CD pipeline, enabling seamless integration and data flow between different components of an automation stack.

  • Using Terraform to install software on existing servers.

    Why it's wrong here

    Terraform is fundamentally an infrastructure provisioning tool, designed to create, modify, and destroy infrastructure components like virtual machines, networks, and databases. Installing software packages, configuring operating system settings, or deploying applications onto *existing* servers falls squarely within the domain of configuration management tools (e.g., Ansible, Chef, Puppet) or specialized deployment platforms, which operate at a higher level of abstraction than Terraform's infrastructure focus.

  • Using Terraform as a CI/CD pipeline tool.

    Why it's wrong here

    Terraform is an infrastructure as code (IaC) tool used for defining and provisioning infrastructure, not a comprehensive CI/CD pipeline orchestrator. While it is an essential component *within* CI/CD pipelines, executing specific infrastructure deployment steps, it does not provide the overarching capabilities for build automation, testing, artifact management, or the sequential orchestration of various deployment stages that characterize a full-fledged CI/CD platform like Jenkins, GitLab CI, or GitHub Actions.

  • Using Terraform state to generate infrastructure diagrams.

    Why this is correct

    The Terraform state file (`terraform.tfstate`) acts as a canonical record of all infrastructure resources managed by Terraform, meticulously detailing their attributes, configurations, and interdependencies. This rich, structured data is a valuable source of truth that can be programmatically parsed by external tools or scripts to automatically generate visual representations, such as infrastructure diagrams, dependency graphs, or inventory lists, providing an accurate and up-to-date visualization of the deployed environment.

About these practice questions

One of 428 original TF-004 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This TF-004 practice question is part of Courseiva's free HashiCorp certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the TF-004 exam.