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 Amazon CloudFormation User Guide.
Syntax
To declare this entity in your Amazon Serverless Application Model (Amazon 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
Amazon CloudFormation compatibility: This property is unique to Amazon SAM and doesn't have an Amazon CloudFormation equivalent.
-
PreTraffic
-
Lambda function that is run before traffic shifting.
Type: String
Required: No
Amazon CloudFormation compatibility: This property is unique to Amazon SAM and doesn't have an Amazon CloudFormation equivalent.
Examples
Hooks
Example hook functions
YAML
Hooks: PreTraffic: Ref: PreTrafficLambdaFunction PostTraffic: Ref: PostTrafficLambdaFunction