An EKS managed node group shows drift on `scaling_config[0].desired_size` and launch template version after every cluster upgrade.
AdvancedTroubleshootingLost, Corrupted and Drifted State
Answer
Likely causes → Cluster Autoscaler/Karpenter changes desired_size; console or eksctl upgrades bump the launch template version and AMI release outside Terraform.
Diagnose → aws eks describe-nodegroup --cluster-name prod --nodegroup-name general --query 'nodegroup.[scalingConfig,launchTemplate,releaseVersion]'
Fix → ignore_changes = [scaling_config[0].desired_size], and do upgrades through Terraform (version, release_version or the launch template) instead of the console.
Prevent → One upgrade path only. Block eks:UpdateNodegroupVersion for humans in prod.
More on Lost, Corrupted and Drifted State
Someone deleted the state object from the S3 bucket. `terraform plan` now wants to create 140 resources that already exist.IntermediateState is gone and the bucket had no versioning. How do you recover a production stack?Advanced`Error: Failed to load state` followed by a JSON error like `invalid character '}' looking for beginning of object key string`.IntermediateThe plan prints `Note: Objects have changed outside of Terraform` and lists a security group with an extra ingress rule.BeginnerEvery plan wants to change `desired_capacity` on an Auto Scaling group back to 2, though autoscaling has raised it to 6.BeginnerA resource was deleted manually in the console. The plan wants to create it, and an apply fails because a dependent resource still references the old ID.Intermediate