FlashGenius Logo FlashGenius
Login Sign Up

TERRAFORM-003 Practice Questions: Use Terraform outside the core workflow Domain

Test your TERRAFORM-003 knowledge with 5 practice questions from the Use Terraform outside the core workflow domain. Includes detailed explanations and answers.

TERRAFORM-003 Practice Questions

Master the Use Terraform outside the core workflow Domain

Test your knowledge in the Use Terraform outside the core workflow domain with these 5 practice questions. Each question is designed to help you prepare for the TERRAFORM-003 certification exam with detailed explanations to reinforce your learning.

Question 1

You are managing an infrastructure with Terraform and need to update a resource that has been moved to a different module. You want to ensure that the state reflects this change without causing a resource recreation. Which feature should you use to accomplish this?

A) Use the `moved` block in your Terraform configuration.

B) Use `terraform apply -replace` to update the state.

C) Use `terraform init -reconfigure` to refresh the state.

D) Use `terraform import` to bring the resource into the new module.

Show Answer & Explanation

Correct Answer: A

Explanation: The `moved` block is used to inform Terraform about resources that have been moved to a different location in the configuration. This updates the state without recreating the resource. `terraform apply -replace` forces recreation, `terraform init -reconfigure` is for backend configuration, and `terraform import` is for importing existing resources.

Question 2

While managing a Terraform project, you notice that a resource is being recreated unnecessarily during each `terraform apply`. What is the best way to prevent this behavior?

A) Use `lifecycle { ignore_changes = ["*"] }` in the resource block.

B) Use `terraform apply -replace` to force recreation only when needed.

C) Use `lifecycle { prevent_destroy = true }` in the resource block.

D) Remove the resource from the Terraform configuration.

Show Answer & Explanation

Correct Answer: A

Explanation: Option A is correct because `lifecycle { ignore_changes = ["*"] }` prevents Terraform from detecting changes to the resource, thus avoiding unnecessary recreations. Option B is incorrect because it forces recreation, not prevention. Option C is incorrect because `prevent_destroy` prevents deletion, not recreation. Option D is incorrect as it removes the resource from management, which is not the goal.

Question 3

You are working with Terraform workspaces to manage different environments for your application. You mistakenly deployed a resource in the wrong workspace. What is the best way to correct this mistake without affecting the other environments?

A) Use `terraform apply -replace` to force recreation in the correct workspace.

B) Delete the resource manually from the cloud provider and redeploy using the correct workspace.

C) Switch to the correct workspace using `terraform workspace select` and redeploy the resource.

D) Use `terraform destroy` in the current workspace and then redeploy in the correct workspace.

Show Answer & Explanation

Correct Answer: C

Explanation: Option C is correct because switching to the correct workspace with `terraform workspace select` allows you to manage resources in the intended environment without affecting other workspaces. Option A does not address the issue of the workspace context. Option B involves manual steps that can lead to inconsistencies. Option D unnecessarily destroys resources, which is not ideal.

Question 4

You are configuring a Terraform project to use variable validation for a variable that accepts a list of strings. Which feature should you use to ensure that each string in the list matches a specific pattern?

A) Use `validation` blocks within the variable definition.

B) Define a `for_each` loop to iterate and check each string.

C) Implement a `count` condition to validate each string.

D) Apply a `depends_on` constraint to enforce validation.

Show Answer & Explanation

Correct Answer: A

Explanation: The `validation` block within a variable definition allows you to specify conditions that each element of a list must satisfy. This is the most appropriate and direct way to enforce pattern matching for variable values. Option B and C are not suitable for validation purposes, and option D is used for resource dependencies, not validation.

Question 5

You are managing a Terraform configuration for a multi-cloud environment using AWS and Azure. You need to update a resource in AWS but want to ensure that the Azure resources remain unchanged. Which command should you use to achieve this without affecting the Azure resources?

A) terraform apply -replace='aws_instance.my_instance'

B) terraform apply -target='aws_instance.my_instance'

C) terraform apply -replace='azure_resource_group.my_group'

D) terraform apply -target='azure_resource_group.my_group'

Show Answer & Explanation

Correct Answer: A

Explanation: The command 'terraform apply -replace='aws_instance.my_instance'' is used to force the recreation of a specific AWS resource without affecting other resources. Option B targets a resource for update but does not force recreation. Options C and D incorrectly refer to Azure resources, which you do not intend to change.

Ready to Accelerate Your TERRAFORM-003 Preparation?

Join thousands of professionals who are advancing their careers through expert certification preparation with FlashGenius.

  • ✅ Unlimited practice questions across all TERRAFORM-003 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
Start Free Practice Now

Already have an account? Sign in here

About TERRAFORM-003 Certification

The TERRAFORM-003 certification validates your expertise in use terraform outside the core workflow 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.

Next Steps: Drill Terraform Associate (003) by Domain

Lock in concepts with targeted domain practice, then take a full exam simulation in FlashGenius for a real test feel.

Start Terraform Practice Now
Tip: Use Exam Simulation + Smart Review in FlashGenius to mirror the real test and fix weak spots fast.

More Help with Terraform Associate (003)

Use this Terraform Cheat Sheet to quickly review core commands, IaC concepts, and workflow steps. Pair it with FlashGenius practice tests to get fully exam-ready.

Open Terraform Cheat Sheet