HashiCorp Certified: Terraform Associate (004) · Difficulty

Hard Terraform Associate practice questions

Challenge — multi-step scenarios, trade-offs, and subtle distinctions. 6 hard questions available — no sign-up, always free.

Question 1 of 6

You maintain a reusable networking module that must deploy resources into a secondary AWS region. In the root module you have configured a default AWS provider and an aliased provider named `aws.secondary`. You want the child module to use the aliased provider for all of its resources. What is the correct way to pass this provider configuration to the module?

Reviewed for accuracy · Report an issue
Question 2 of 6

A platform team publishes reusable Terraform modules as versioned .zip archives on an internal artifact server reachable at https://artifacts.example.com. A downstream team wants to consume a specific packaged version of the networking module without using Git or the public/private registry. Which module source configuration correctly references the archive?

Reviewed for accuracy · Report an issue
Question 3 of 6

Your team is splitting a large Terraform configuration into two separate root modules, each with its own remote backend state file. A resource named aws_db_instance.primary currently exists in the original state file but should now be managed by the new configuration without destroying and recreating the live database. Which approach correctly moves this resource between the two separate state files?

Reviewed for accuracy · Report an issue
Question 4 of 6

A teammate manually renamed an S3 bucket in the AWS console, breaking the mapping in your Terraform state. The next terraform plan proposes to destroy the old bucket (which no longer exists) and create a new one. You want to keep the current live bucket under Terraform management without destroying it, and without changing its resource address in the configuration. Which approach accomplishes this?

Reviewed for accuracy · Report an issue
Question 5 of 6

A DevOps engineer manually created an EC2 instance directly in the AWS console. It is not tracked by Terraform, but a colleague accidentally added a matching resource block and ran 'terraform apply', which created a SECOND duplicate instance that Terraform now tracks in state. The team wants Terraform to manage the ORIGINAL console-created instance and delete the accidental duplicate. What is the correct sequence of actions?

Reviewed for accuracy · Report an issue
Question 6 of 6

Your team initially configured Terraform with a local backend. After creating a shared S3 backend block in the configuration, a colleague runs 'terraform init' and is prompted about copying existing state to the new backend. They accidentally decline, and later realize the backend settings in the configuration have changed again. They want to re-run initialization to apply the new backend configuration WITHOUT being prompted to migrate or copy existing state. Which command should they use?

Reviewed for accuracy · Report an issue