FlashGenius Logo FlashGenius
Login Sign Up

TERRAFORM-003 Practice Questions: Understand Terraform basics Domain

Test your TERRAFORM-003 knowledge with 5 practice questions from the Understand Terraform basics domain. Includes detailed explanations and answers.

TERRAFORM-003 Practice Questions

Master the Understand Terraform basics Domain

Test your knowledge in the Understand Terraform basics 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 infrastructure across AWS and Azure using Terraform. You need to ensure that an S3 bucket in AWS is created before a storage account in Azure. How can you explicitly define this dependency in your Terraform configuration?

A) Use the `depends_on` argument in the Azure storage account resource to reference the S3 bucket.

B) Use `count = 1` in both resources to ensure they are created in order.

C) Use `for_each` to iterate over both resources, ensuring order.

D) Terraform automatically manages dependencies; no action is needed.

Show Answer & Explanation

Correct Answer: A

Explanation: The `depends_on` argument is used in Terraform to explicitly declare a dependency between resources. By adding `depends_on` to the Azure storage account resource, you ensure that Terraform creates the S3 bucket first. Options B and C are incorrect because they do not explicitly manage dependencies. Option D is incorrect because while Terraform does manage implicit dependencies, explicit dependencies need `depends_on`.

Question 2

You are managing infrastructure using Terraform and need to ensure that a specific resource in your configuration is recreated during the next apply operation. Which command should you use to achieve this?

A) terraform apply -replace=module.example

B) terraform plan -replace=module.example

C) terraform refresh -replace=module.example

D) terraform init -replace=module.example

Show Answer & Explanation

Correct Answer: A

Explanation: The correct command to force the recreation of a resource during the next apply is `terraform apply -replace=`. This command marks the resource for replacement in the state file, ensuring it is destroyed and recreated. Option B is incorrect because `terraform plan` does not apply changes. Option C is incorrect because `terraform refresh` is deprecated and does not support `-replace`. Option D is incorrect because `terraform init` is used for initializing a Terraform configuration, not replacing resources.

Question 3

You are managing infrastructure with Terraform and need to replace an existing AWS EC2 instance due to configuration drift. Which command should you use to force the recreation of this resource?

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

B) terraform destroy -target='aws_instance.example'

C) terraform plan -refresh-only

D) terraform taint 'aws_instance.example'

Show Answer & Explanation

Correct Answer: A

Explanation: The 'terraform apply -replace' command is used to force the recreation of a resource. Option B would destroy the resource but not recreate it. Option C is used for refreshing the state without making changes. Option D is deprecated in Terraform 1.x.

Question 4

You are using Terraform workspaces to manage environments. What happens when you run `terraform plan` without specifying a workspace?

A) Terraform uses the default workspace.

B) Terraform prompts you to select a workspace.

C) Terraform uses the last used workspace.

D) Terraform throws an error about missing workspace.

Show Answer & Explanation

Correct Answer: A

Explanation: If you run `terraform plan` without specifying a workspace, Terraform uses the default workspace. This is because the default workspace is the initial and primary workspace when none is specified. Option B is incorrect because Terraform does not prompt for a workspace selection. Option C is incorrect because Terraform does not automatically use the last used workspace unless it's the default. Option D is incorrect because Terraform does not throw an error in this scenario.

Question 5

You are tasked with ensuring that a specific Terraform resource is not accidentally destroyed. Which lifecycle argument should you use in the resource block to achieve this?

A) ignore_changes

B) prevent_destroy

C) create_before_destroy

D) replace_triggered_by

Show Answer & Explanation

Correct Answer: B

Explanation: The 'prevent_destroy' lifecycle argument is used to prevent a resource from being accidentally destroyed. This is useful for critical resources that should not be deleted. Option A is incorrect because 'ignore_changes' is used to ignore changes to specific attributes. Option C is incorrect because 'create_before_destroy' ensures that a new resource is created before the old one is destroyed. Option D is incorrect because 'replace_triggered_by' is used to trigger replacement of a resource based on changes in other resources.

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 understand terraform basics 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