Skip to content

(aws-appmesh): App Mesh Routes with a weight of 0 are being auto-assigned a weight of 1 #21365

@srinivas-kini

Description

@srinivas-kini

Describe the bug

I am creating an App Mesh route spec. where one virtual node (VN) has a weight of 100 (or 1 in relative terms), and the other virtual node has a weight of 0.

However, once the CDK deployment is done, the route with the weight 0 is being changed to 1 automatically. This is regardless of the relative weight of the other route.

For example, VN1 has a weight of 1 and VN2 has a weight of 0, it becomes 1 for both. Which means the traffic is split 50/50.
If VN1 has a weight of 100 and VN2 has a weight of 0, it becomes 100,1. In the case the traffic is split 99/1.

image

image

The weight has to be manually changed to 0 in the AWS Console UI.

Expected Behavior

Routes with targets of weight 0 should not change to 1 automatically.

Current Behavior

Routes with targets of weight 0 are being changed to 1 automatically.

Reproduction Steps

Provision a mesh that has 2 virtual nodes. Add the virtual nodes to a virtual router as targets, and assign one node a weight of 0.

this.virtualRouter = new appmesh.VirtualRouter(this, `${this.stackName}VritualRouter`, {
      mesh: this.mesh,
      virtualRouterName: "ColorTellerVirtualRouter",
      listeners: [appmesh.VirtualRouterListener.http(80)],
    });

    this.route = new appmesh.Route(this, `${this.stackName}BackendRoute`, {
      mesh: this.mesh,
      virtualRouter: this.virtualRouter,
      routeName: "ColorTellerRoute",
      routeSpec: appmesh.RouteSpec.http({
        weightedTargets: [
          {
            virtualNode: this.virtualNodeWhite,
            weight: 100,
          },
          {
            virtualNode: this.virtualNodeGreen,
            weight: 0,
          },
        ],
      }),
    });

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.27.0 (build 8e89048)

Framework Version

No response

Node.js Version

v18.3.0

OS

macOS Monterey (12.4)

Language

Typescript

Language Version

3.9.7

Other information

No response

Metadata

Metadata

Labels

@aws-cdk/aws-appmeshRelated to AWS App MeshbugThis issue is a bug.effort/smallSmall work item – less than a day of effortgood first issueRelated to contributions. See CONTRIBUTING.mdp1

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions