It seems like Terraform/OpenTofu wants to report changes to the status of an EKS node group as diffs, even though this is state managed AWS-side that Terraform can't directly affect:
Note: Objects have changed outside of OpenTofu
OpenTofu detected the following changes made outside of OpenTofu since the
last "tofu apply" which may have affected this plan:
# module.sandbox.module.eks.module.eks_managed_node_group["spot"].aws_eks_node_group.this[0] has changed
~ resource "aws_eks_node_group" "this" {
id = "sandbox-eks:spot-k8s-nodes-20240125181518727500000013"
~ status = "DEGRADED" -> "ACTIVE"
tags = {
"Name" = "spot-k8s-nodes"
}
# (15 unchanged attributes hidden)
# (4 unchanged blocks hidden)
}
(This is part of a much larger configuration, but we see this diff sometimes when one terraform run happens when spot instances are being replaced and then the next plan happens once the node group is fully up to strength.)
[x] β I have searched the open/closed issues and my issue is not listed.
Description
It seems like Terraform/OpenTofu wants to report changes to the status of an EKS node group as diffs, even though this is state managed AWS-side that Terraform can't directly affect:
(This is part of a much larger configuration, but we see this diff sometimes when one terraform run happens when spot instances are being replaced and then the next plan happens once the node group is fully up to strength.)
Versions
Module version [Required]: 20.24.0
Terraform version:
Provider version(s):
provider registry.opentofu.org/hashicorp/aws v5.64.0
provider registry.opentofu.org/hashicorp/helm v2.15.0
provider registry.opentofu.org/hashicorp/kubernetes v2.32.0
provider registry.opentofu.org/hashicorp/null v3.2.2
provider registry.opentofu.org/hashicorp/time v0.12.0
provider registry.opentofu.org/hashicorp/tls v4.0.5
provider registry.terraform.io/hashicorp/aws v5.64.0
provider registry.terraform.io/hashicorp/cloudinit v2.3.4
provider registry.terraform.io/hashicorp/helm v2.15.0
provider registry.terraform.io/hashicorp/kubernetes v2.32.0
provider registry.terraform.io/hashicorp/null v3.2.2
provider registry.terraform.io/hashicorp/time v0.12.0
provider registry.terraform.io/hashicorp/tls v4.0.5
Reproduction Code [Required]
Steps to reproduce the behavior:
We are running
terraform plan
andterraform apply
from GitHub Actions on PRs / submit.Expected behavior
No reported diffs even when EKS node groups using spot instances are being cycled.
Actual behavior
We sometimes see the above diff, with no real way to avoid it.
Terminal Output Screenshot(s)
See above
Additional context
I suspect this mostly happens with spot instances, as on-demand / reserved instances won't disappear out from under the node pool in the same way.