AWS::CloudFormation::HookVersion - 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).


The HookVersion resource publishes new or first hook version to the Amazon CloudFormation registry.


To declare this entity in your Amazon CloudFormation template, use the following syntax:


{ "Type" : "AWS::CloudFormation::HookVersion", "Properties" : { "ExecutionRoleArn" : String, "LoggingConfig" : LoggingConfig, "SchemaHandlerPackage" : String, "TypeName" : String } }


Type: AWS::CloudFormation::HookVersion Properties: ExecutionRoleArn: String LoggingConfig: LoggingConfig SchemaHandlerPackage: String TypeName: String



The Amazon Resource Name (ARN) of the task execution role that grants the hook permission.

Required: No

Type: String

Pattern: arn:.+:iam::[0-9]{12}:role/.+

Maximum: 256

Update requires: Replacement


Contains logging configuration information for an extension.

Required: No

Type: LoggingConfig

Update requires: Replacement


A URL to the Amazon S3 bucket containing the hook project package that contains the necessary files for the hook you want to register.

For information on generating a schema handler package for the resource you want to register, see submit in the CloudFormation CLI User Guide for Extension Development.


The user registering the resource must be able to access the package in the S3 bucket. That's, the user must have GetObject permissions for the schema handler package. For more information, see Actions, Resources, and Condition Keys for Amazon S3 in the Amazon Identity and Access Management User Guide.

Required: Yes

Type: String

Maximum: 4096

Update requires: Replacement


The unique name for your hook. Specifies a three-part namespace for your hook, with a recommended pattern of Organization::Service::Hook.


The following organization namespaces are reserved and can't be used in your hook type names:

  • Alexa

  • AMZN

  • Amazon

  • ASK

  • AWS

  • Custom

  • Dev

Required: Yes

Type: String

Pattern: ^[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}$

Update requires: Replacement

Return values


When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the ARN of the resource version. For example:


For more information about using the Ref function, see Ref.


The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.


The Amazon Resource Name (ARN) of the hook.


Whether the specified hook version is set as the default version.


The Amazon Resource Number (ARN) assigned to this version of the hook.


The ID of this version of the hook.


The scope at which the resource is visible and usable in CloudFormation operations.

Valid values include:

  • PRIVATE: The resource is only visible and usable within the account in which it's registered. CloudFormation marks any resources you register as PRIVATE.

  • PUBLIC: The resource is publicly visible and usable within any Amazon account.


Specifying a hook version

The following example demonstrates how to specify a new hook version.


{ "AWSTemplateFormatVersion": "2010-09-09", "Resources": { "HookVersion": { "Type": "AWS::CloudFormation::HookVersion", "Properties": { "TypeName": "My::Sample::Hook", "SchemaHandlerPackage": "s3://my-sample-hookversion-bucket/" } } } }


AWSTemplateFormatVersion: 2010-09-09 Resources: HookVersion: Type: 'AWS::CloudFormation::HookVersion' Properties: TypeName: 'My::Sample::Hook' SchemaHandlerPackage: 's3://my-sample-hookversion-bucket/'

Specifying the default hook version

The following example demonstrates how to specify a new hook version and use the Ref return value to set that version as the default version.


{ "AWSTemplateFormatVersion": "2010-09-09", "Resources": { "HookVersion": { "Type": "AWS::CloudFormation::HookVersion", "Properties": { "TypeName": "My::Sample::Hook", "SchemaHandlerPackage": "s3://my-sample-hookversion-bucket/" } }, "HookDefaultVersion": { "Type": "AWS::CloudFormation::HookDefaultVersion", "Properties": { "TypeVersionArn": { "Ref": "HookVersion" } } } } }


AWSTemplateFormatVersion: 2010-09-09 Resources: HookVersion: Type: AWS::CloudFormation::HookVersion Properties: TypeName: My::Sample::Hook SchemaHandlerPackage: s3://my-sample-hookversion-bucket/ HookDefaultVersion: Type: AWS::CloudFormation::HookDefaultVersion Properties: TypeVersionArn: !Ref HookVersion