What Terraform command always causes a state file to be updated with changes that might have been made outside of Terraform?
What Terraform command always causes a state file to be updated with changes that might have been made outside of Terraform?
The 'terraform plan -refresh-only' command updates the state file with the current state of resources in the real world, without performing any changes. It ensures that the state file reflects any changes made outside of Terraform, providing an accurate comparison between the Terraform configurations and the actual infrastructure.
Neither one of them is correct. Should be terraform apply -refresh-only
A - terraform plan -refresh-only
A. The -refresh-only flag with the terraform plan command updates the state file with the current state of the real resources, without applying any changes. This command compares the current state of the infrastructure with the Terraform configuration and updates the state file with any changes that were made externally.
A. is the closest answer but not quite the right command that would make the changes to the state file. Its terraform apply -refresh-only
A. terraform plan -refresh-only
non is correct , some thing maybe wrong with this question , should be terraform refresh i think
A is the correct answer