Always execute post statement in a jenkins pipeline when a conditional statement is met
According to the documentation, the when directive is only allowed inside a stage. You have to use the script directive if you want to use conditional statements:

post {
  always {
    script {
      if (DeleteStack == 'true') {
        // Destroy what you want !
      }
    }
  }
}