TERRAFORM-004 Practice Questions: Infrastructure as Code Concepts Domain
Test your TERRAFORM-004 knowledge with 10 practice questions from the Infrastructure as Code Concepts domain. Includes detailed explanations and answers.
TERRAFORM-004 Practice Questions
Master the Infrastructure as Code Concepts Domain
Test your knowledge in the Infrastructure as Code Concepts domain with these 10 practice questions. Each question is designed to help you prepare for the TERRAFORM-004 certification exam with detailed explanations to reinforce your learning.
Question 1
Your organization uses AWS CloudFormation for some stacks and wants to introduce Terraform for multi-cloud deployments. A manager asks how Terraform differs from CloudFormation from an IaC perspective. Which answer is the most accurate?
Show Answer & Explanation
Correct Answer: B
Terraform and CloudFormation are both declarative IaC tools, but Terraform is provider-agnostic and can manage resources across many platforms (clouds, SaaS, etc.) using providers (B). This is a key IaC concept: one tool, many providers.
(A) Terraform can manage many types of resources, not just servers. (C) Terraform is also declarative; you describe desired state, not step-by-step procedures. (D) Terraform can import existing resources using `terraform import` or import blocks; it is not limited to resources it originally created.
Question 2
A team manages AWS infrastructure with Terraform and wants to adopt Infrastructure as Code practices more strictly. Currently, each engineer clicks through the AWS console to create test resources, then later re-creates them in Terraform. They also sometimes forget which manual changes were made. Which change in workflow best applies Infrastructure as Code principles using Terraform?
Show Answer & Explanation
Correct Answer: B
Infrastructure as Code means infrastructure is defined, versioned, and changed through code, not manual clicks. Option B aligns with IaC by requiring all changes to go through Terraform configuration and `terraform apply`, ensuring reproducibility, auditability, and reduced configuration drift. Option A still relies on manual creation and only imports later, which breaks consistent IaC practice. Option C adds an unnecessary manual step and still uses the console to apply changes. Option D accepts ongoing manual changes, which causes drift and undermines the benefits of IaC, even if `terraform plan` reveals differences.
Question 3
A team currently provisions test servers manually in a cloud console. They want to move to Terraform so that every test environment is created the same way and can be destroyed and recreated easily. Which benefit of Infrastructure as Code best describes what Terraform will provide in this scenario?
Show Answer & Explanation
Correct Answer: B
The scenario highlights consistency and easy recreation of environments. Terraform, as an IaC tool, provides idempotent, repeatable infrastructure changes defined in code and stored in version control (B). This is the core benefit here.
(A) Auto-scaling is a cloud feature; Terraform can configure it but does not automatically scale based on CPU without explicit configuration. (C) Zero-downtime is not guaranteed; it depends on how resources are modeled (e.g., blue/green, rolling updates). (D) Terraform does not automatically roll back to a previous state when a plan has changes; you must choose whether to apply or not, and rollbacks are a manual design decision.
Question 4
A team wants to adopt Infrastructure as Code with Terraform. They plan to store Terraform configuration in Git, use pull requests for review, and run terraform plan in CI before merging. From an IaC perspective, what is the primary advantage of this workflow?
Show Answer & Explanation
Correct Answer: B
Storing Terraform code in Git and using PRs with terraform plan in CI aligns infrastructure changes with software development practices: changes are version-controlled, reviewable, and revertible. A is incorrect because plans can still fail at apply time due to external factors. C is incorrect because Git tracks configuration, not live resource state; Terraform state is still required. D is incorrect because Terraform does not autonomously fix resources without explicit apply and human approval in this workflow.
Question 5
Your organization uses AWS CloudFormation for some stacks and is evaluating Terraform for new projects. They ask why Terraform might be preferable for multi-cloud Infrastructure as Code. Which reason best aligns with Terraform’s design?
Show Answer & Explanation
Correct Answer: A
Terraform is provider-agnostic and uses the same core workflow (init/plan/apply) and HCL language across many providers, which is attractive for multi-cloud IaC. B is incorrect; there is no built-in automatic conversion from CloudFormation to Terraform. C is incorrect because CloudFormation itself is also declarative for AWS. D is incorrect because Terraform still requires provider configuration (e.g., aws, azurerm, google) for each platform.
Question 6
Your company already uses Ansible to configure application servers after they are created. You propose using Terraform to create the underlying cloud infrastructure (VPCs, subnets, instances). How does Terraform’s role in an IaC workflow differ from Ansible’s in this scenario?
Show Answer & Explanation
Correct Answer: A
In a common IaC pattern, Terraform handles provisioning and lifecycle management of infrastructure (networks, instances, managed services), while Ansible focuses on configuration management inside those resources (packages, files, services). B is incorrect because they are not interchangeable and have different strengths. C is incorrect because Terraform is widely used for cloud infrastructure, not limited to SaaS. D is incorrect because Terraform interacts directly with providers’ APIs and does not require Ansible to create resources.
Question 7
A team currently uses Ansible playbooks to configure software on already-provisioned virtual machines. They are considering Terraform and ask where Terraform best fits in their workflow from an IaC standpoint. How should you position Terraform relative to Ansible?
Show Answer & Explanation
Correct Answer: B
Terraform is typically used for provisioning and lifecycle management of infrastructure resources (VMs, networks, managed services) as declarative IaC, while Ansible is often used for configuration management and application deployment on top of those resources (B). Many teams use both together.
(A) Terraform does not necessarily replace Ansible; they solve different layers of the stack. (C) Terraform is not limited to DNS; it manages a wide range of resources. (D) Both tools can express dependencies, but Terraform is declarative; you describe desired state, not a strict sequence of imperative tasks like a script.
Question 8
A team uses Terraform to manage AWS infrastructure. Some engineers still occasionally modify resources directly in the AWS console. Later, Terraform plans show unexpected changes. From an Infrastructure as Code perspective, what is the most appropriate process change to reduce this problem?
Show Answer & Explanation
Correct Answer: B
IaC best practice is to treat Terraform configuration as the single source of truth and require all infrastructure changes to go through code review and Terraform workflows. This minimizes drift caused by manual console changes. A is harmful; locking helps prevent conflicting state changes. C is not a sustainable process; -replace is for targeted recreation, not routine workflow. D moves away from centralized, auditable IaC and makes drift and conflicts more likely.
Question 9
You manage a production VPC with Terraform. A new engineer suggests editing the cloud console directly for a quick firewall rule change and "fixing the Terraform code later." From an Infrastructure as Code perspective, what is the best response?
Show Answer & Explanation
Correct Answer: B
A core IaC practice is that infrastructure changes are made through code and applied via Terraform, keeping configuration, state, and real infrastructure aligned (B). Direct console changes create drift and can cause unexpected plans or failures.
(A) Terraform will show drift in `terraform plan`, but it will not automatically revert console changes; you must choose to apply. (C) `terraform refresh` is deprecated and not part of recommended workflows in Terraform 1.x; and it still wouldn’t enforce using code as the source of truth. (D) Terraform state is critical for managing existing resources; console changes can break assumptions in state and configuration.
Question 10
A team currently provisions cloud resources manually in the console. They want to adopt Terraform so that every environment (dev, test, prod) is created from the same configuration and can be recreated if accidentally deleted. Which benefit of Infrastructure as Code best describes what Terraform will provide in this scenario?
Show Answer & Explanation
Correct Answer: B
Terraform lets you define infrastructure declaratively in code and store it in version control, so you can consistently recreate environments and track changes over time. This is a core benefit of IaC. A is incorrect because Terraform does not automatically optimize costs; you must design resources accordingly. C is incorrect because Terraform manages infrastructure, not application performance tuning. D is incorrect because Terraform helps reduce drift when used properly, but it cannot guarantee the absence of drift, especially if changes are made outside Terraform.
Ready to Accelerate Your TERRAFORM-004 Preparation?
Join thousands of professionals who are advancing their careers through expert certification preparation with FlashGenius.
- ✅ Unlimited practice questions across all TERRAFORM-004 domains
- ✅ Full-length exam simulations with real-time scoring
- ✅ AI-powered performance tracking and weak area identification
- ✅ Personalized study plans with adaptive learning
- ✅ Mobile-friendly platform for studying anywhere, anytime
- ✅ Expert explanations and study resources
Already have an account? Sign in here
About TERRAFORM-004 Certification
The TERRAFORM-004 certification validates your expertise in infrastructure as code concepts and other critical domains. Our comprehensive practice questions are carefully crafted to mirror the actual exam experience and help you identify knowledge gaps before test day.