AWS::CloudFormation::HookVersion - AWS CloudFormation

AWS::CloudFormation::HookVersion

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

Syntax

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

JSON

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

YAML

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

Properties

ExecutionRoleArn

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

LoggingConfig

Contains logging configuration information for an extension.

Required: No

Type: LoggingConfig

Update requires: Replacement

SchemaHandlerPackage

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.

Note

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 AWS Identity and Access Management User Guide.

Required: Yes

Type: String

Maximum: 4096

Update requires: Replacement

TypeName

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

Note

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

Ref

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

arn:aws:cloudformation:us-west-2:012345678901:type/hook/Sample-CloudFormation-Hook/00000001

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

Fn::GetAtt

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.

Arn

The Amazon Resource Name (ARN) of the hook.

IsDefaultVersion

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

TypeArn

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

VersionId

The ID of this version of the hook.

Visibility

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.

Examples

Specifying a hook version

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

JSON

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

YAML

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

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.

JSON

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

YAML

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