terraform-aws-eks icon indicating copy to clipboard operation
terraform-aws-eks copied to clipboard

Creating an ipv6 cluster results in error on delete

Open andrei-dascalu opened this issue 3 years ago β€’ 0 comments

Description

I have create an ipv6 cluster with coredns enabled.

On deletion, I am getting this error

Error: error deleting IAM policy arn:aws:iam::774392577521:policy/AmazonEKS_CNI_IPv6_Policy: DeleteConflict: Cannot delete a policy attached to entities.
β”‚       status code: 409
  • [x] βœ‹ I have searched the open/closed issues and my issue is not listed.

⚠️ Note

Before you submit an issue, please perform the following first:

  1. Remove the local .terraform directory (! ONLY if state is stored remotely, which hopefully you are following that best practice!): rm -rf .terraform/
  2. Re-initialize the project root to pull down modules: terraform init
  3. Re-attempt your terraform plan or apply and check if the issue still persists

Versions

  • Module version [Required]: 18.26.6

  • Terraform version: Terraform v1.2.5

  • Provider version(s):

Terraform v1.2.5
on darwin_amd64
+ provider registry.terraform.io/hashicorp/aws v4.23.0
+ provider registry.terraform.io/hashicorp/cloudinit v2.2.0
+ provider registry.terraform.io/hashicorp/kubernetes v2.12.1
+ provider registry.terraform.io/hashicorp/local v2.2.3
+ provider registry.terraform.io/hashicorp/null v3.1.1
+ provider registry.terraform.io/hashicorp/random v3.3.2
+ provider registry.terraform.io/hashicorp/tls v3.4.0

Reproduction Code [Required]

Steps to reproduce the behavior:

  • create cluster
  • destroy cluster

Expected behavior

cluster destroyed successfully

Actual behavior

Error

β”‚ Error: error deleting IAM policy arn:aws:iam::<accountID>:policy/AmazonEKS_CNI_IPv6_Policy: DeleteConflict: Cannot delete a policy attached to entities.
β”‚       status code: 409

Additional context

The only additional policy I'm attaching is this

iam_role_additional_policies = ["arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly"]

It looks really strange to me that terraform thinks it has to destroy a builtin policy

andrei-dascalu avatar Jul 24 '22 13:07 andrei-dascalu