AWS::CloudFormation::HookDefaultVersion
The AWS::CloudFormation::HookDefaultVersion
resource specifies the default
version of a Hook. The default version of the Hook is used in CloudFormation
operations for this AWS account and AWS Region.
For information about the CloudFormation registry, see Managing extensions with the CloudFormation registry in the AWS CloudFormation User Guide.
This resource type is not compatible with Guard and Lambda Hooks.
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
, orTypeName
andVersionId
.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
, orTypeName
andVersionId
.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
, orTypeName
andVersionId
.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 Hook 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 Hook, 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://amzn-s3-demo-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://amzn-s3-demo-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