Loading...
Loading...
### Terraform Version ```shell Terraform v1.13.1 on linux_amd64 + provider registry.terraform.io/hashicorp/aws v6.11.0 + provider registry.terraform.io/hashicorp/http v3.5.0 + provider registry.terraform.io/hashicorp/local v2.5.3 + provider registry.terraform.io/hashicorp/random v3.7.2 + provider registry.terraform.io/hashicorp/tls v4.1.0 ``` ### Terraform Configuration Files ``` variable "eks_k8s_version" { description = "If a Kubernetes version other than the current default for the default EKS version is desired, set this variable to the desired K8s version. Note that if you set this to a version in extended support status, a warning will be generated but the cluster will still be provisioned and may incur extra costs." type = string default = "" } resource "aws_eks_cluster" "simple_eks" { name = "[cluster name]" [...] version = var.eks_k8s_version == "" ? null : var.eks_k8s_version [...] } resource "aws_eks_node_group" "ec2" { cluster_name = aws_eks_cluster.simple_eks.name node_group_name = "[nodegroup name]" version = aws_eks_cluster.simple_eks.version [...] } ``` ### Debug Output Running with trace on generated so much trace that it ran off my scrollback, but if needed I can generate a minimal test case config that I can share and that hopefully will not generate quite so much trace output. ### Expected Behavior Terraform should have either upgraded both the cluster and nodegroup in-place, or destroyed and then recreated both. ### Actual Behavior Terraform attempts to destroy the cluster but only change the nodegroup, which results in the following failure: ``` Error: deleting EKS Cluster ([cluster-name]): operation error EKS: DeleteCluster, https response error StatusCode: 409, RequestID: 64ba437d-f278-4dec-9ed1-af7ffb0828fb, ResourceInUseException: Cluster has nodegroups attached ``` ### Steps to Reproduce 1. Create an `aws_eks_cluster` and `aws_eks_node_group` with an explicit `version`. 2. Update the resources with a null `version` (e.g. by deleting the `version` arguments). 3. Apply again. No changes are planned. 4. Taint the `aws_eks_cluster` resource. 5. Apply again. Terraform generates a plan that will delete the existing `aws_eks_cluster`, create a new `aws_eks_cluster`, and update the `aws_eks_node_group` in-place, however the cluster delete fails with the error noted above. ### Additional Context If I taint the nodegroup resource as well, then both resources are deleted and recreated in the correct order. ### References This appears to be the same error that was reported in #29732. ### Generative AI / LLM assisted development? None
Click on a version to see all relevant bugs
Terraform Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.