A teammate made emergency manual changes to AWS during an incident without updating Terraform. Now your state is out of sync.
The interviewer asks“Your team discovers that the actual AWS infrastructure has diverged from your Terraform state file. Resources were manually changed or deleted. How do you handle this safely?”
Run terraform plan to detect drift, use terraform import to bring manually-created resources into state, use terraform state rm for removed resources, never delete state blindly. Always work with a team and lock state.
A free account unlocks the rest of it, and saves your progress across every track.
terraform init Prepare a Terraform working directoryterraform plan Preview what Terraform will changeterraform apply Create, change or destroy real infrastructureterraform state Inspect and repair Terraform's stateansible Run one task across many servers (ad-hoc)ansible-playbook Run Ansible playbooks to configure serverspuppet Enforce server configuration with Puppet