I use TF (v0.13.5) to create k8s cluster in AWS (EKS) + EFS. At some point today I ran
terraform apply and while waiting for it to finish I realised I had made a mistake in TF code and hit CTRL-C. Fixed the code and then ran
terraform destroy. It went well (at least it said so …). Then ran
terraform apply again but it says that some of the defined objects already exists
This is the error:
Error: Error creating EFS file system: FileSystemAlreadyExists: File system ‘fs-d167101b’ already exists with creation token ‘eks-sth-efs’
Message_: “File system ‘fs-d167101b’ already exists with creation token ‘eks-sth-efs’”
Error: Error creating Security Group: InvalidGroup.Duplicate: The security group ‘eks-sth-efs-mount-sg’ already exists for VPC ‘vpc-018a5c1975bd146dd’
status code: 400, request id: 65208153-3a12-4cda-8180-3d640c5eb304
Error: Error import KeyPair: InvalidKeyPair.Duplicate: The keypair ‘eks-sth’ already exists.
status code: 400, request id: 8f12548a-4bc8-48d7-ac64-a4eeff733d28
Error: error creating EKS Cluster (eks-sth-ci04): ResourceInUseException: Cluster already exists with name: eks-sth-ci04
Message_: “Cluster already exists with name: eks-sth”
Error: open ./id_rsa: permission denied
It looks like
terraform destroy doesn’t destroy the objects.
Can anyone enlighten me and tell how can I make sure all objects are destroyed ?