Add types for lifecycle events.

OK. Presumably there are other ways a task could fail and get killed though, like OOM. Perhaps remove the reference to specifically failing health checks?