Handling CodeDeploy event for canary deploys in Java

I’ve read the blog entry on canary-deploys and I’m trying to implement a preHook in Java.

I can’t find any information on how to get started. What interface do I implement? I assume it’s RequestHandler but what request/event will I get and what response should I return?

The SDK documentation for CodeDeploy models is huge and does not provide a clue that I can find about how to handle an event.

I experimented yesterday and figured this out. I’ve writen a quick post on my blog.