How to tell Terraform delete Security Group of AWS EKS Cluster

Hello, I couldn’t find a way to tell terraform delete Security Group within AWS EKS Cluster. The Cluster it selfs deletes without any problem, however the Default AWS EKS security group is still on VPC console, and it does not allowing me to delete VPC

Is this the security group automatically created by AWS when the EKS cluster is created? If so, this SG isn’t under the control of Terraform and so would not be removed (or touched in any other way).

1 Like

@stuart-c Yes you’re right this is default AWS EKS security group which is creating with AWS EKS.
So is there any workaround without using bash or other scripts

Not really as Terraform knows nothing about this SG.

You could add code to define the SG and then do a terraform import, but then it would also try to create the SG initially as well.

1 Like