Hook configuration schema syntax reference - Amazon CloudFormation
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Hook configuration schema syntax reference

This section outlines the schema syntax used to configure Hooks. CloudFormation uses this configuration schema at runtime when invoking a Hook in an Amazon Web Services account.

To enable your Hook to proactively inspect the configuration of your stack, set the HookInvocationStatus to ENABLED after the Hook has been registered and activated in your account.

Note

The maximum amount of data that a Hook’s configuration can store is 300 KB. This is in addition to all the constraints imposed on Configuration request parameter of SetTypeConfiguration operation.

Hook configuration schema properties

The following schema is the structure for a Hook configuration schema.

{ "CloudFormationConfiguration": { "HookConfiguration": { "HookInvocationStatus": "ENABLED", "TargetOperations": ["STACK"], "FailureMode": "FAIL", "Properties": { ... } } } }
HookConfiguration

Hook configuration supports activating or deactivating Hooks at stack level, failure modes, and Hook properties values.

The Hook configuration supports the following properties.

HookInvocationStatus

Specifies if the Hook is ENABLED or DISABLED.

Valid values: ENABLED | DISABLED

TargetOperations

Specifies the list of operations the Hook is run against. For more information, see Hook targets.

Valid values: STACK | RESOURCE | CHANGE_SET | CLOUD_CONTROL

TargetStacks

Available for backward compatibility. Use HookInvocationStatus instead.

If the mode is set to ALL, the Hook applies to all stacks in your account during a CREATE, UPDATE, or DELETE resource operation.

If the mode is set to NONE, the Hook won't apply to stacks in your account.

Valid values: ALL | NONE

FailureMode

This field tells the service how to treat Hook failures.

  • If the mode is set to FAIL, and the Hook fails, then the fail configuration stops provisioning resources and rolls back the stack.

  • If the mode is set to WARN and the Hook fails, then the warn configuration allows provisioning to continue with a warning message.

Valid values: FAIL | WARN

Properties

Specifies Hook runtime properties. These should match the shape of the properties supported by Hooks schema.

Hook configuration examples

For examples of configuring Hooks from the Amazon CLI, see the following sections: