

# Developing custom Hooks using the CloudFormation CLI
<a name="hooks-develop"></a>

This section is for customers who want to develop custom Hooks and register them in the CloudFormation registry. It provides an overview of the structure of CloudFormation Hooks, and guides for developing, registering, testing, managing, and publishing your own Hooks with Python or Java.

There are three major steps in developing a custom Hook:

1. **Initiate**

   To develop custom Hooks, you must configure and use the CloudFormation CLI. To initiate a Hook's project and its required files, use the CloudFormation CLI [https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-cli-init.html](https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-cli-init.html) command and specify that you want to create a Hook. For more information, see [Initiating a custom CloudFormation Hooks project](hooks-init.md).

1. **Model**

   To model, author, and validate your Hook schema, define the Hook, its properties, and their attributes.

   The CloudFormation CLI creates empty handler functions which correspond to a specific Hook invocation point. Add your own logic to these handlers to control what happens during your Hook invocation at each stage of its target lifecycle. For more information, see [Modeling custom CloudFormation Hooks](hooks-model.md).

1. **Register**

   To register a Hook, submit your Hook to be registered either as a private or a public third-party extension. Register your Hook with the `[submit](https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-cli-submit.html)` operation. For more information, see [Registering a custom Hook with CloudFormation](registering-hooks.md).

   The following tasks are associated with registering your Hook:

   1. *Publish* – Hooks are published to the registry.

   1. *Configure* – Hooks are configured when the type configuration invokes against stacks.
**Note**  
Hooks will time out after 30 seconds and retry up to 3 times. For more information, see [Timeout and retry limits](hooks-concepts.md#hook-timeout-and-retry-limits).

**Topics**
+ [Prerequisites](hooks-prerequisites.md)
+ [Initiating a Hooks project](hooks-init.md)
+ [Modeling Hooks](hooks-model.md)
+ [Registering Hooks](registering-hooks.md)
+ [Testing Hooks](testing-hooks.md)
+ [Updating Hooks](updating-registered-hook.md)
+ [Deregistering Hooks](deregistering-hooks.md)
+ [Publishing Hooks](hooks-publishing.md)
+ [Schema syntax](hooks-schema.md)