Importing a live resource without matching configuration can lead to an unexpected plan that changes or replaces it. Checks to make Back up state, identify the exact resource and provider address, write configuration matching observed settings, import in a controlled workspace, and review the full plan. Require peer review before applying any proposed...
Replacement can be triggered by immutable changes, provider behavior, or state drift. Checks to make Review full plan and provider version, confirm state and resource identity, inspect dependencies, and test safely. Do not approve destructive changes from a summary. When to get help Infrastructure engineering can improve plan review and drift...
Moving Terraform state to a new backend can appear complete while one workspace still points to the old location or a lock remains. Running an apply against an empty or incorrect state can recreate resources or modify production unexpectedly. Verify the state move Record the old backend, workspace names, state versions, and migration timestamp. Confirm...
A manual cloud-console change may solve an urgent issue but leave Terraform or other infrastructure code outdated. Later deployments can overwrite the change or recreate a configuration that no longer meets security or availability needs. Track changes at the control plane Enable audit records for administrative actions and assign owners to critical...
A Terraform module that works in one environment may produce unexpected changes elsewhere because variables, provider versions, or existing infrastructure differ. Reusing a change broadly before checking plans can replace resources, alter access, or create inconsistent environments. Build representative test cases Choose environments that cover common...
Terraform may refuse to run because a state lock remains after a terminal closed, a runner stopped, or a network interruption. Removing the lock without confirming that no process is still changing state can allow concurrent writes and damage the infrastructure record. Identify the lock holder Read the lock details, backend logs, pipeline status, and...
Manual edits can create drift that is invisible until a later plan tries to revert or replace a resource. Checks to make Run scheduled plans in a read-only workflow, alert on meaningful drift, identify who changed the resource using audit logs, and reconcile the desired configuration before applying. Do not auto-apply drift corrections without review....
Terraform drift occurs when real infrastructure no longer matches the configuration and state Terraform uses. Someone may have changed a resource in a console, a provider may have altered defaults, or a resource may be managed by another tool. An automated apply can then overwrite a deliberate emergency change or affect unrelated resources. Investigate...