Skip to content
v2.278.0

WeightedTarget Struct ​

Properties for the Weighted Targets in the route.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_appmesh as appmesh } from 'aws-cdk-lib';

declare const virtualNode: appmesh.VirtualNode;
const weightedTarget: appmesh.WeightedTarget = {
  virtualNode: virtualNode,

  // the properties below are optional
  port: 123,
  weight: 123,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_appmesh as appmesh

# virtual_node: appmesh.VirtualNode

weighted_target = appmesh.WeightedTarget(
    virtual_node=virtual_node,

    # the properties below are optional
    port=123,
    weight=123
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.appmesh.*;

VirtualNode virtualNode;

WeightedTarget weightedTarget = WeightedTarget.builder()
        .virtualNode(virtualNode)

        // the properties below are optional
        .port(123)
        .weight(123)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.AppMesh;

VirtualNode virtualNode;

var weightedTarget = new WeightedTarget {
    VirtualNode = virtualNode,

    // the properties below are optional
    Port = 123,
    Weight = 123
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var virtualNode VirtualNode

weightedTarget := &WeightedTarget{
	VirtualNode: virtualNode,

	// the properties below are optional
	Port: jsii.Number(123),
	Weight: jsii.Number(123),
}

Properties ​

portoptionalnumberportoptionalint | floatportoptionalNumberPortoptionaldoublePortoptional*float64 #
The port to match from the request.

Default: do not match on port

virtualNodeIVirtualNodevirtual_nodeIVirtualNodevirtualNodeIVirtualNodeVirtualNodeIVirtualNodeVirtualNodeIVirtualNode required #
The VirtualNode the route points to.
weightoptionalnumberweightoptionalint | floatweightoptionalNumberWeightoptionaldoubleWeightoptional*float64 = 1 #
The weight for the target.