Question 240
A site reliability lead wants the simplest supported Terraform mechanism to rename a configured object while preserving its existing remote identity. Which option is correct?
Explanation
Correct Answer
Moved blocks declare state address migration during refactoring. This meets the stated requirement to rename a configured object while preserving its existing remote identity.
Incorrect Answers
terraform plan -refresh-only is intended to inspect whether Terraform state should record intentional external changes without making infrastructure match HCL; refresh-only mode reconciles state to reality. That is not the specific requirement to rename a configured object while preserving its existing remote identity.
Resource removed block with destroy false is intended to stop managing a still-needed remote object without planning its deletion; removed blocks express intentional state-only removal. That is not the specific requirement to rename a configured object while preserving its existing remote identity.
Normal terraform plan drift detection is intended to identify an out-of-band change to a managed network rule and propose restoring configuration; normal planning compares current reality with desired config. That is not the specific requirement to rename a configured object while preserving its existing remote identity.






HashiCorp Certified: Terraform Associate (004) (Terraform Associate 004) Practice Tests