terraform-provider-spotinst icon indicating copy to clipboard operation
terraform-provider-spotinst copied to clipboard

Unable to delete security groups because of dangling ENIs

Open imranismail opened this issue 5 years ago • 5 comments

After provisioning ocean cluster and setting up a few pods inside it. Upon destroying resources using terraform I'm always stuck at deleting the worker security groups because of dangling ENIs.

imranismail avatar Sep 18 '19 08:09 imranismail

@imranismail you can configure network interfaces to be deleted by using the delete_on_termination attribute in the network_interface block, e.g.:

  network_interface {
    device_index                = 0
    description                 = "<Your Description>."
    delete_on_termination       = true
    associate_public_ip_address = true
  }

Please refer to the docs for further information.

CarlosDomingues avatar Nov 04 '19 16:11 CarlosDomingues

@CarlosDomingues That is for elastigroup. For ocean I don't see any option to configure this.

imranismail avatar Nov 04 '19 18:11 imranismail

Hi @imranismail, thanks for your comment. We've been looking into it and tried to reproduce it using the eks_ocean.tf template we offer in our documentation. On our end, it seems like everything is working properly. Would you be able to contact Spotinst support and provide them with your template in order for them to look into the issue?

danielle-297 avatar Nov 05 '19 14:11 danielle-297

@danielle-297 did you try launching a few services inside the cluster? That's when the ENIs get created.

imranismail avatar Nov 05 '19 18:11 imranismail

It's worth noting that when deleting an EKS cluster you must delete your "LoadBalancer" service types first. EKS does not clean this up for you at the time of this writing.

mateothegreat avatar Nov 17 '20 03:11 mateothegreat