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
Deleting instance from cloud console will result terraform to create instance again to match what written in tf config files
the correct answer is C.
Answer is C.
C is correct
C is the correct answer !
The Answer is C
it is very clear
stupid
C is the correct ans
C is correct
C is the answer. Terraform will detect the missing instances and create them to match the tf config file.