0
0
Terraformcloud~20 mins

Why importing existing resources matters in Terraform - Challenge Your Understanding

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Terraform Import Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Why import existing cloud resources into Terraform?

Imagine you have cloud resources created manually or by another tool. Why is it important to import these resources into Terraform?

ATo delete all existing resources before creating new ones.
BBecause Terraform cannot create new resources without importing existing ones first.
CTo let Terraform manage and track the resource state, preventing accidental deletion or duplication.
DTo automatically convert resources into a different cloud provider format.
Attempts:
2 left
💡 Hint

Think about how Terraform keeps track of resources it manages.

Architecture
intermediate
2:00remaining
What happens if you don't import existing resources before applying Terraform?

You have a virtual machine created manually in your cloud. You write Terraform code for it but do not import it. What will Terraform do when you run terraform apply?

ATerraform will delete the existing virtual machine immediately.
BTerraform will automatically detect and manage the existing virtual machine.
CTerraform will fail with an error and stop.
DTerraform will create a new virtual machine, possibly causing duplicates.
Attempts:
2 left
💡 Hint

Terraform only manages resources it knows about in its state file.

security
advanced
2:30remaining
How does importing resources improve security in Terraform workflows?

Consider a team managing cloud infrastructure with Terraform. How does importing existing resources help improve security?

AIt prevents accidental deletion or modification of resources not tracked by Terraform.
BIt encrypts all imported resources automatically in the cloud provider.
CIt disables access to imported resources for all users except Terraform admins.
DIt forces all users to authenticate with multi-factor authentication before applying changes.
Attempts:
2 left
💡 Hint

Think about how Terraform tracks and manages resources and what happens if it doesn't know about some resources.

service_behavior
advanced
2:30remaining
What is the effect on Terraform state after importing a resource?

After running terraform import for a resource, what changes occur in Terraform's behavior and state?

ATerraform deletes the resource from the cloud and removes it from state.
BTerraform state now includes the resource, so future plans and applies manage it without recreating.
CTerraform ignores the resource during planning and applying until manually added to code.
DTerraform converts the resource into a local file outside of state management.
Attempts:
2 left
💡 Hint

Consider what Terraform state is and how import affects it.

Best Practice
expert
3:00remaining
Which Terraform workflow best handles existing cloud resources?

You inherit a cloud environment with many manually created resources. You want to manage them with Terraform without downtime or resource loss. Which workflow is best?

AWrite Terraform code matching existing resources, then import each resource into Terraform state before applying.
BDelete all existing resources first, then create them fresh with Terraform code.
CRun <code>terraform apply</code> immediately with new code and let Terraform fix conflicts automatically.
DIgnore existing resources and only manage new resources with Terraform.
Attempts:
2 left
💡 Hint

Think about how to avoid downtime and keep resources safe while adopting Terraform.