Describe the bug
While the CfnRoute give us the ability to define a route with weighted targets with a port, the L2 construct WeightedTarget does not have that property (only have virtual_node and weight), leveraging us to use L1 constructs instead if we want to use the port specification.
Port is required for routes to nodes that have multiple listeners.
Expected Behavior
WeightedTarget L2 construct also let us specify the port option.
Current Behavior
WeightedTarget L2 construct does not have the property port.
Reproduction Steps
Example in python; the following is not valid code:
appmesh.RouteSpec.grpc(
weighted_targets=[appmesh.WeightedTarget(virtual_node=node, port=myPortNumber)],
match=appmesh.GrpcRouteMatch(port=myPortNumber),
)
We need to use L1 construct, to get the same result:
appmesh.CfnRoute.RouteSpecProperty(
grpc_route=appmesh.CfnRoute.GrpcRouteProperty(
action=appmesh.CfnRoute.GrpcRouteActionProperty(
weighted_targets=[appmesh.CfnRoute.WeightedTargetProperty(
virtual_node=node.virtual_node_name,
weight=1,
port=myPortNumber,
)],
),
match=appmesh.CfnRoute.GrpcRouteMatchProperty(port=myPortNumber),
),
)
Possible Solution
Add the Port property to the construct interface, since is already a property in the CloudFormation specs.
Additional Information/Context
No response
CDK CLI Version
2.85.0
Framework Version
2.85.0
Node.js Version
v16.14.2
OS
MacOs Ventura
Language
Python
Language Version
python 3.11.1
Other information
I have checked through the CDK docs that typescript CDK version have the same issue, so I guess this applies to all languages available.
I can work in a fix if there is no reason to not work on this fix.
Describe the bug
While the
CfnRoutegive us the ability to define a route with weighted targets with a port, the L2 constructWeightedTargetdoes not have that property (only havevirtual_nodeandweight), leveraging us to use L1 constructs instead if we want to use the port specification.Port is required for routes to nodes that have multiple listeners.
Expected Behavior
WeightedTargetL2 construct also let us specify theportoption.Current Behavior
WeightedTargetL2 construct does not have the propertyport.Reproduction Steps
Example in python; the following is not valid code:
We need to use L1 construct, to get the same result:
Possible Solution
Add the
Portproperty to the construct interface, since is already a property in the CloudFormation specs.Additional Information/Context
No response
CDK CLI Version
2.85.0
Framework Version
2.85.0
Node.js Version
v16.14.2
OS
MacOs Ventura
Language
Python
Language Version
python 3.11.1
Other information
I have checked through the CDK docs that typescript CDK version have the same issue, so I guess this applies to all languages available.
I can work in a fix if there is no reason to not work on this fix.