Skip to content

Conversation

@ipmb
Copy link
Member

@ipmb ipmb commented Nov 14, 2025

When disabling deletion protection during cluster deletion (PreDelete), gracefully handle the case where the load balancer no longer exists. This can happen if the load balancer was manually deleted or the stack is in a failed state.

  • Add LoadBalancerNotFoundException error handling
  • Log as debug and continue with stack deletion instead of failing
  • Only applies when turning deletion protection off (value=false)
  • Turning deletion protection on still returns errors as expected

When disabling deletion protection during cluster deletion (PreDelete),
gracefully handle the case where the load balancer no longer exists.
This can happen if the load balancer was manually deleted or the stack
is in a failed state.

- Add LoadBalancerNotFoundException error handling
- Log as debug and continue with stack deletion instead of failing
- Only applies when turning deletion protection off (value=false)
- Turning deletion protection on still returns errors as expected
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the robustness of cluster deletion by gracefully handling cases where the load balancer has already been removed. When disabling deletion protection during the PreDelete phase, the code now catches LoadBalancerNotFoundException and logs it as a debug message instead of failing the deletion process.

  • Adds error handling for LoadBalancerNotFoundException when disabling deletion protection
  • Maintains strict error handling when enabling deletion protection
  • Aligns with existing error handling pattern in the same function for missing CloudFormation outputs

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ipmb ipmb merged commit 9860839 into main Nov 14, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants