-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(eks): introduce option to not delete eks cluster, like removal policy #25544
Comments
This is an interesting idea. The general purpose of delete protection is to protect the data from being removed when we destroy the stack. In EKS, if we keep the cluster with all the |
@pahud this was created based off an internal ticket - we should follow up with them |
Hi, it was me who filed the internal ticket, thanks for looking into this. @pahud It would be ideal for the delete protection to protect the whole cluster infrastructure, so in case the stack is accidentally deleted, at least the cluster should require some manual action to be fully deleted. |
@paulocesarias It makes perfect sense to me and I appreciate your ideas. We probably need to define what the "whole cluster infrastructure" includes before we figure out how to move to the next step. The cluster of aws-eks is essentially created by a cluster resource handler as custom resource in which the cluster resource handler calls the API rather than using AWS::EKS::Cluster resoruce. As custom resource does have removalPolicy I think it's possible to "protect" this custom resource from being deleted by exposing a prop like: new eks.Cluster(scope, id ,{
...,
removalPolicy: RemovalPolicy.RETAIN,
}); However, there are a lot of k8s resources running in this cluster and having this property configured as |
@pahud, this is exactly what I would expect from this. Also, I am assuming that deleting the cluster directly from the AWS EKS console, or just |
Describe the feature
The Cluster resource is implemented with a custom resource, so Cfn RemovalPolicies cannot apply. We should provide an option to not delete the cluster when the custom resource gets deleted
Use Case
When I want to delete the stack but not my cluster
Proposed Solution
Introduce a prop on EKS Cluster L2, this prop then will be read in the custom resource handler on the delete event and decide whether to follow through with deletion or not.
Other Information
No response
Acknowledgements
CDK version used
latest
Environment details (OS name and version, etc.)
mac
The text was updated successfully, but these errors were encountered: