View a markdown version of this page

RevisionWeights - Amazon Serverless Application Model
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).

RevisionWeights

Specifies how a Web Function endpoint splits traffic across revisions. Use this property when AutoDeploymentMode is Disabled, for example to run a canary or blue/green deployment.

RevisionWeights is a map. Each key is a revision ID, and each value is the percentage of traffic to route to that revision. The following rules apply:

  • Specify at most two revisions.

  • Each weight is an integer from 1 to 100, and the weights must add up to 100.

  • Individual weights can be intrinsic functions, but the map itself can't be an intrinsic function.

Type: Map

Amazon CloudFormation compatibility: This property is similar to the RevisionWeights property of an AWS::Lambda::WebFunctionEndpoint resource. Amazon SAM converts the map into a list of objects, each with a RevisionId and a Weight.

Syntax

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

YAML

revision-id: Integer revision-id: Integer

Examples

Canary split

The following example sends 90% of traffic to rev-abc123 and 10% to rev-def456.

AutoDeploymentMode: Disabled RevisionWeights: rev-abc123: 90 rev-def456: 10

Amazon SAM transforms this into the following endpoint property:

RevisionWeights: - RevisionId: rev-abc123 Weight: 90 - RevisionId: rev-def456 Weight: 10