A junior admin accidentally deleted some of your cloud instances. What does Terraform do when you run terraform apply?
A junior admin accidentally deleted some of your cloud instances. What does Terraform do when you run terraform apply?
When you run 'terraform apply', Terraform compares the current state of your infrastructure with the desired state specified in your configuration files. If any instances are found to be missing, Terraform will recreate only those instances to match the desired state. It does not rebuild the entire infrastructure, nor does it stop and generate an error. Terraform's purpose is to ensure the actual state matches the desired state as defined in your configuration files, and it will take appropriate actions to achieve this.
C Terraform would refresh and check that the Current State in the state file is not thesame as the Desired State. Terraform will check its configuration resource files and if it finds a resource that is present in the state file but not in the Desired state, it will create it
vote for C
C is the correct answer !
C is correct
Deleting instance from cloud console will result terraform to create instance again to match what written in tf config files
Answer is C.
the correct answer is C.
C is the correct ans
it is very clear
The Answer is C