Hooks - AWS Serverless Application Model

Hooks

Validation Lambda functions that are run before and after traffic shifting.

Note

The Lambda functions referenced in this property configure the CodeDeployLambdaAliasUpdate object of the resulting AWS::Lambda::Alias resource. For more information, see CodeDeployLambdaAliasUpdate Policy in the AWS CloudFormation User Guide.

Syntax

To declare this entity in your AWS Serverless Application Model (AWS SAM) template, use the following syntax.

YAML

PostTraffic: String PreTraffic: String

Properties

PostTraffic

Lambda function that is run after traffic shifting.

Type: String

Required: No

AWS CloudFormation compatibility: This property is unique to AWS SAM and doesn't have an AWS CloudFormation equivalent.

PreTraffic

Lambda function that is run before traffic shifting.

Type: String

Required: No

AWS CloudFormation compatibility: This property is unique to AWS SAM and doesn't have an AWS CloudFormation equivalent.

Examples

Hooks

Example hook functions

YAML

Hooks: PreTraffic: Ref: PreTrafficLambdaFunction PostTraffic: Ref: PostTrafficLambdaFunction