AWS::CloudFormation::HookDefaultVersion - AWS CloudFormation

AWS::CloudFormation::HookDefaultVersion

The HookDefaultVersion resource specifies the default version of the hook. The default version of the hook is used in CloudFormation operations for this AWS account and AWS Region.

Syntax

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

JSON

{ "Type" : "AWS::CloudFormation::HookDefaultVersion", "Properties" : { "TypeName" : String, "TypeVersionArn" : String, "VersionId" : String } }

YAML

Type: AWS::CloudFormation::HookDefaultVersion Properties: TypeName: String TypeVersionArn: String VersionId: String

Properties

TypeName

The name of the hook.

You must specify either TypeVersionArn, or TypeName and VersionId.

Required: Conditional

Type: String

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

Update requires: No interruption

TypeVersionArn

The version ID of the type configuration.

You must specify either TypeVersionArn, or TypeName and VersionId.

Required: Conditional

Type: String

Pattern: ^arn:aws[A-Za-z0-9-]{0,64}:cloudformation:[A-Za-z0-9-]{1,64}:([0-9]{12})?:type/hook/.+$

Update requires: No interruption

VersionId

The version ID of the type specified.

You must specify either TypeVersionArn, or TypeName and VersionId.

Required: Conditional

Type: String

Pattern: ^[A-Za-z0-9-]{1,128}$

Update requires: No interruption

Return values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the Amazon Resource Name (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 Number (ARN) of the activated extension, in this account and Region.

Examples

Specifying a hook default 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

Specifying a hook default version using TypeVersionArn

The following example demonstrates how to set a hook version as the default version through the TypeVersionArn property type.

JSON

{ "AWSTemplateFormatVersion": "2010-09-09", "Resources": { "HookDefaultVersion": { "Type": "AWS::CloudFormation::HookDefaultVersion", "Properties": { "TypeVersionArn": "arn:aws:cloudformation:us-west-2:123456789012:type/hook/My-Sample-Hook/00000001" } } } }

YAML

AWSTemplateFormatVersion: 2010-09-09 Resources: HookDefaultVersion: Type: 'AWS::CloudFormation::HookDefaultVersion' Properties: TypeVersionArn: >- arn:aws:cloudformation:us-west-2:123456789012:type/hook/My-Sample-Hook/00000001

Specifying a hook default version using TypeName and VersionId

The following example demonstrates how to set a hook version as the default version through the VersionId property type.

JSON

{ "AWSTemplateFormatVersion": "2010-09-09", "Resources": { "HookDefaultVersion": { "Type": "AWS::CloudFormation::HookDefaultVersion", "Properties": { "TypeName": "My::Sample::Hook", "VersionId": 1 } } } }

YAML

AWSTemplateFormatVersion: 2010-09-09 Resources: HookDefaultVersion: Type: 'AWS::CloudFormation::HookDefaultVersion' Properties: TypeName: 'My::Sample::Hook' VersionId: 1