diff --git a/cluster/aws/util.sh b/cluster/aws/util.sh index 50d260eae50..58f8162a0b4 100755 --- a/cluster/aws/util.sh +++ b/cluster/aws/util.sh @@ -1345,6 +1345,11 @@ function kube-down { done echo "All instances deleted" fi + if [[ -n $(${AWS_ASG_CMD} describe-launch-configurations --launch-configuration-names ${ASG_NAME} --query LaunchConfigurations[].LaunchConfigurationName) ]]; then + echo "Warning: default auto-scaling launch configuration ${ASG_NAME} still exists, attempting to delete" + echo " (This may happen if kube-up leaves just the launch configuration but no auto-scaling group.)" + ${AWS_ASG_CMD} delete-launch-configuration --launch-configuration-name ${ASG_NAME} || true + fi find-master-pd find-tagged-master-ip