Ravindra BagaleCourses & study guides मराठी

Ravi Sir's Cards › DevOps

Chapter 42: Terraform Drift and Troubleshooting: Cards

मराठी cards · Open the chapter

Revision cards

Drift: when AWS no longer matches the code. Hand changes in the console make the code lie about what is running, and the next apply may undo them by surprise.
Revision card 1 of 3: Drift: when AWS no longer matches the code · Download PNG · Open card page

Lesson: 42.1 Drift — when AWS no longer matches the code

Troubleshooting with TF_LOG. Some errors give one short line. You need more detail to see which API call failed.
Revision card 2 of 3: Troubleshooting with TF_LOG · Download PNG · Open card page

Lesson: 42.2 Troubleshooting with TF_LOG and the common errors

Troubleshooting table: error, cause, fix. The same handful of errors make up most Terraform failures. Knowing them saves hours.
Revision card 3 of 3: Troubleshooting table: error, cause, fix · Download PNG · Open card page

Lesson: 42.3 Troubleshooting table — error, cause, fix

Interview cards

What is drift, and how do you handle it? Drift is when real cloud resources differ from Terraform state and code, usually after a manual change. Detect it with terraform plan or plan -refresh-only.
Interview card 1 of 3: What is drift, and how do you handle it? · Download PNG · Open card page

Lesson: 42.1 Drift — when AWS no longer matches the code

How do you get more detail when Terraform fails? Set TF_LOG=DEBUG (or TRACE) and TF_LOG_PATH=tf.log, then re-run. The log shows provider API calls and errors.
Interview card 2 of 3: How do you get more detail when Terraform fails? · Download PNG · Open card page

Lesson: 42.2 Troubleshooting with TF_LOG and the common errors

Terraform says “Error acquiring the state lock”. What do you do? Another run holds the lock, or a crashed run left it. First check if someone or a pipeline is running. Only if the run is definitely dead, use terraform force-unlock LOCK_ID.
Interview card 3 of 3: Terraform says “Error acquiring the state lock”. What do you do? · Download PNG · Open card page

Lesson: 42.3 Troubleshooting table — error, cause, fix

Comparison cards

Drift vs code change. Both make plan show changes.Drift: the real cloud changed outside Terraform.Code change: someone edited the .tf files.
Comparison card 1 of 3: Drift vs code change · Download PNG · Open card page

Lesson: Chapter 42: Terraform Drift and Troubleshooting

TF_LOG=DEBUG vs TF_LOG=TRACE. Both turn on detailed Terraform logs.DEBUG: detailed.TRACE: the most detailed, every step.
Comparison card 2 of 3: TF_LOG=DEBUG vs TF_LOG=TRACE · Download PNG · Open card page

Lesson: Chapter 42: Terraform Drift and Troubleshooting

Wait for the lock vs force-unlock. Wait: let the other run finish (or use -lock-timeout=5m).force-unlock: remove the lock by hand.
Comparison card 3 of 3: Wait for the lock vs force-unlock · Download PNG · Open card page

Lesson: Chapter 42: Terraform Drift and Troubleshooting