Interview Prep/Terraform/Plan Errors and Unexpected Replacements

A plan wants to replace an EKS cluster after changing `subnet_ids`.

AdvancedTroubleshootingPlan Errors and Unexpected Replacements
Answer

Likely causes → Depending on provider and API support, some vpc_config changes require a new cluster; a module upgrade may also change subnet ordering or the cluster name.

Diagnose → terraform plan | grep -B3 'forces replacement' inside module.eks.

Fix → Stop. Revert the change, or check whether AWS now allows updating it via aws eks update-cluster-config and wait for provider support. For real migrations, build a second cluster and migrate workloads (blue/green).

Prevent → Gate any plan containing delete on aws_eks_cluster, RDS, or other stateful/critical resources.

All Terraform questions

More on Plan Errors and Unexpected Replacements