Skip to content

Conversation

aemada-aws
Copy link
Contributor

Issue # (if applicable)

Closes #.

Reason for this change

Added the removalPolicy prop to the EKS cluster. This will apply the removal policy to all resources created by the cluster including node groups, roles, vpc and security groups.

Description of changes

Added removalPolicy property to the ClusterProps interface in the EKS library that allows users to specify a removal policy for all CloudFormation resources created by the EKS cluster construct.

  • Added readonly removalPolicy?: RemovalPolicy to ClusterProps interface
  • Added integration test integ.eks-cluster-retain.ts to verify removal policy functionality with RemovalPolicy.RETAIN

The removal policy affects the EKS cluster itself, associated IAM roles, node groups, security groups, VPC resources, and any other CloudFormation resources managed by this construct.

Describe any new or updated permissions being added

No new IAM permissions are required for this change.

Description of how you validated changes

  • Added integration test integ.eks-cluster-retain.ts that creates an EKS cluster with RemovalPolicy.RETAIN
  • The test verifies that all resources can be deployed successfully with the removal policy applied
  • Unit tests validate the removal policy is properly applied to the construct tree

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@aemada-aws aemada-aws marked this pull request as draft September 23, 2025 15:25
@aws-cdk-automation aws-cdk-automation requested a review from a team September 23, 2025 15:25
@github-actions github-actions bot added the p2 label Sep 23, 2025
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Sep 23, 2025
@aemada-aws aemada-aws force-pushed the removal-policy-eks-v2-alpha branch from 63c3f76 to 9a7715e Compare September 23, 2025 15:26
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This review is outdated)

@aemada-aws aemada-aws force-pushed the removal-policy-eks-v2-alpha branch 2 times, most recently from 68f0857 to c4a5575 Compare September 25, 2025 13:28
@aemada-aws aemada-aws marked this pull request as ready for review September 25, 2025 13:30
@aemada-aws aemada-aws force-pushed the removal-policy-eks-v2-alpha branch 2 times, most recently from 5b73c19 to 58e7399 Compare October 1, 2025 09:48
@aws-cdk-automation aws-cdk-automation dismissed their stale review October 1, 2025 09:49

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@aemada-aws aemada-aws force-pushed the removal-policy-eks-v2-alpha branch from 58e7399 to 05ddd5a Compare October 2, 2025 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants