DEV Community

Prithiviraj R
Prithiviraj R

Posted on

Protect EKS Clusters from Accidental Deletion

Enabling deletion protection safeguards clusters from unintended removal. When enabled, deletion protection must be disabled before the cluster can be deleted. Attempting to delete an active cluster with deletion protection enabled will result in an InvalidRequestException.

To enable deletion protection for an existing cluster (must be in Active status):

`aws eks update-cluster-config \
 --deletion-protection \
 --name <cluster-name> \
 --profile <profile-name> \
 --region <region>`
Enter fullscreen mode Exit fullscreen mode

To disable deletion protection for an existing cluster:


aws eks update-cluster-config \
 --no-deletion-protection \
 --name <cluster-name> \
 --profile <profile-name> \
 --region <region>
Enter fullscreen mode Exit fullscreen mode

ref: https://docs.aws.amazon.com/eks/latest/userguide/deletion-protection.html

Top comments (0)