Hello!
I’ve come over from AWS CloudFormation in which I built a fully automated cluster deployment Template that used an Auto-Scaling-Group. For reasons, I require to have the ‘Terminate’ policy suspended - Though tricky, I managed to get this done within the CFT: When deleting a cluster, the CF is smart enough to know to essentially ‘undo’ that policy suspension so the cluster can be deleted.
Copying this all over to Terraform, I have the exact same process. With Terraform it’s actually simpler, because I can create an ASG right off the bat with the terminate policy suspended (suspended_processes = [ “Terminate” ])
However, should I attempt to destroy this cluster it hangs indefinitely. It clears everything as it should up to the ASG, at which point it attempts to delete the cluster - But because of the policy in place, it fails to do it until I manually un-suspend the policy via EC2 (or however else).
Any possibility of either/or for the following:
A) A work-a-round to automate this within my single Terraform script (anyone any ideas?)
B) Fix the issue internally as, in my opinion, it is considered a bug.
My only idea, though I’m not currently sure how to do it, is to essentially have an IF clause within the script that updates the ASG (removes the policy suspension) IF it is running a ‘destroy’ process - No idea if that is possible.
Thanks in advance for any feedback.