0
0
Terraformcloud~10 mins

Terraform state rm for removing resources - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to remove a resource named 'aws_instance.example' from the Terraform state.

Terraform
terraform state rm [1]
Drag options to blanks, or click blank then click option'
Aaws_instance.example
Baws_instance.example.id
Cexample.aws_instance
Dterraform.aws_instance.example
Attempts:
3 left
💡 Hint
Common Mistakes
Adding '.id' to the resource address
Using incorrect resource address format
Including extra prefixes before the resource address
2fill in blank
medium

Complete the command to remove multiple resources at once from the Terraform state.

Terraform
terraform state rm [1]
Drag options to blanks, or click blank then click option'
Aaws_instance.example1,aws_instance.example2
Baws_instance.example1 aws_instance.example2
Caws_instance.example1;aws_instance.example2
Daws_instance.example1|aws_instance.example2
Attempts:
3 left
💡 Hint
Common Mistakes
Using commas or semicolons to separate resource addresses
Using pipes or other symbols instead of spaces
3fill in blank
hard

Fix the error in the command to remove a resource from Terraform state.

Terraform
terraform state rm [1]
Drag options to blanks, or click blank then click option'
Aaws_instance-example
Baws_instance.example id
Caws_instance.example/
Daws_instance.example
Attempts:
3 left
💡 Hint
Common Mistakes
Replacing dots with dashes
Adding trailing slashes
Adding spaces inside the resource address
4fill in blank
hard

Fill both blanks to remove a resource from a specific module in Terraform state.

Terraform
terraform state rm [1].[2]
Drag options to blanks, or click blank then click option'
Amodule.webserver
Baws_instance
Cexample
Dresource
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'resource' instead of the resource name
Omitting the 'module.' prefix
Swapping the order of module and resource
5fill in blank
hard

Fill all three blanks to remove a resource from a nested module in Terraform state.

Terraform
terraform state rm [1].[2].[3]
Drag options to blanks, or click blank then click option'
Amodule.database
Bmodule.backend
Caws_db_instance
Dmain
Attempts:
3 left
💡 Hint
Common Mistakes
Missing one of the module parts
Incorrect order of modules
Using resource name without module path