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

AWS::CloudFormation::HookTypeConfig

The HookTypeConfig resource specifies the configuration of a hook.

Syntax

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

JSON

{ "Type" : "AWS::CloudFormation::HookTypeConfig", "Properties" : { "Configuration" : String, "ConfigurationAlias" : String, "TypeArn" : String, "TypeName" : String } }

YAML

Type: AWS::CloudFormation::HookTypeConfig Properties: Configuration: String ConfigurationAlias: String TypeArn: String TypeName: String

Properties

Configuration

Specifies the activated hook type configuration, in this Amazon Web Services account and Amazon Web Services Region.

You must specify either TypeName and Configuration or TypeARN and Configuration.

Required: Conditional

Type: String

Pattern: [\s\S]+

Update requires: No interruption

ConfigurationAlias

Specifies the activated hook type configuration, in this Amazon Web Services account and Amazon Web Services Region.

Defaults to default alias. Hook types currently support default configuration alias.

Required: No

Type: String

Allowed values: default

Pattern: ^[a-zA-Z0-9]{1,256}$

Update requires: Replacement

TypeArn

The Amazon Resource Number (ARN) for the hook to set Configuration for.

You must specify either TypeName and Configuration or TypeARN and Configuration.

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

TypeName

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

You must specify either TypeName and Configuration or TypeARN and Configuration.

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

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:123456789012:type-configuration/hook/My-Sample-Hook/default

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.

ConfigurationArn

The Amazon Resource Number (ARN) of the activated hook type configuration, in this account and Region.

Examples

Specifying the configuration of a hook using TypeName

The following example demonstrates how to specify a new hook configuration with the TypeName property type.

JSON

{ "AWSTemplateFormatVersion": "2010-09-09", "Resources": { "HookTypeConfig": { "Type": "AWS::CloudFormation::HookTypeConfig", "Properties": { "TypeName": "My::Sample::Hook", "Configuration": "{\"CloudFormationConfiguration\":{\"HookConfiguration\":{\"TargetStacks\":\"ALL\",\"FailureMode\":\"WARN\",\"Properties\":{\"limitSize\": \"1\",\"encryptionAlgorithm\": \"aws:kms\"}}}}" } } } }

YAML

AWSTemplateFormatVersion: 2010-09-09 Resources: HookTypeConfig: Type: AWS::CloudFormation::HookTypeConfig Properties: TypeName: My::Sample::Hook Configuration: '{"CloudFormationConfiguration":{"HookConfiguration":{"TargetStacks":"ALL","FailureMode":"WARN","Properties":{"limitSize": "1","encryptionAlgorithm": "aws:kms"}}}}'

Specifying the configuration of a hook using TypeArn

The following example demonstrates how to specify a new hook configuration with the TypeArn property type.

JSON

{ "AWSTemplateFormatVersion": "2010-09-09", "Resources": { "HookTypeConfig": { "Type": "AWS::CloudFormation::HookTypeConfig", "Properties": { "TypeArn": "arn:aws:cloudformation:us-west-2:123456789012:type/hook/My-Sample-Hook", "Configuration": "{\"CloudFormationConfiguration\":{\"HookConfiguration\":{\"TargetStacks\":\"ALL\",\"FailureMode\":\"WARN\",\"Properties\":{\"limitSize\": \"1\",\"encryptionAlgorithm\": \"aws:kms\"}}}}" } } } }

YAML

AWSTemplateFormatVersion: 2010-09-09 Resources: HookTypeConfig: Type: AWS::CloudFormation::HookTypeConfig Properties: TypeArn: arn:aws:cloudformation:us-west-2:123456789012:type/hook/My-Sample-Hook Configuration: '{"CloudFormationConfiguration":{"HookConfiguration":{"TargetStacks":"ALL","FailureMode":"WARN","Properties":{"limitSize": "1","encryptionAlgorithm": "aws:kms"}}}}'