Prerequisites for developing AWS CloudFormation Hooks - AWS CloudFormation Hooks

Prerequisites for developing AWS CloudFormation Hooks

Hooks can be developed with Java or Python. The following are the prerequisites for developing Hooks:

Java prerequisites
  • Apache Maven

  • JDK 17

    Note

    If you intend to use the CloudFormation Command Line Interface (CLI) to initiate a Hooks project for Java, you must install Python 3.8 or later as well. The Java plugin for the CloudFormation CLI can be installed through pip (Python's package manager), which is distrubted with Python.

To implement Hook handlers for your Java Hooks project, you can download the Java Hook handler example files.

Python prerequisites

To implement Hook handlers for your Python Hooks project, you can download the Python Hook handler example files.

Permissions for developing Hooks

In addition to the CloudFormation Create, Update, and Delete stack permissions, you'll need access to the following AWS CloudFormation operations. Access to these operations is managed through your IAM role's CloudFormation policy.

Set up a development environment for Hooks

To develop Hooks, you should be familiar with AWS CloudFormation templates, and either Python or Java.

To install the CloudFormation CLI, and the associated plugins:
  1. Install the the CloudFormation CLI with pip, the Python package manager.

    pip3 install cloudformation-cli
  2. Install either the Python or Java plugin for the CloudFormation CLI.

    Python
    pip3 install cloudformation-cli-python-plugin
    Java
    pip3 install cloudformation-cli-java-plugin

To upgrade the CloudFormation CLI and the plugin, you can use the upgrade option.

Python
pip3 install --upgrade cloudformation-cli cloudformation-cli-python-plugin
Java
pip3 install --upgrade cloudformation-cli cloudformation-cli-java-plugin