Delete AWS ENI via cmd
AWS: Delete AWS ENI via cmd — setup and configuration guide.
When deleting an EKS node group, you may encounter a DependencyViolation error caused by lingering Elastic Network Interfaces (ENIs). The commands below extract the security group ID from the error message using sed, then query the AWS API for all ENIs associated with EKS-managed instances so you can identify and clean them up.
1
2
3
4
5
6
7
echo $t
error waiting for EKS Node Group (eks-mlflow:eks-mlflow-cpu-ng) deletion: Ec2SecurityGroupDeletionFailure: DependencyViolation - resource has a dependent object. Resource IDs: [sg-00db6bb5ee949a63c]
echo $t | sed -E 's/^(.*\[)(.*)(\])$/\2/'
aws ec2 describe-network-interfaces --profile jan-toth-ml | jq -r ".NetworkInterfaces[] | select(.Description | startswith(\"aws-K8S-i-\")) | .NetworkInterfaceId"
This post is licensed under CC BY 4.0 by the author.