Skip to content
v2.278.0

HttpRouteActionProperty Struct ​

An object that represents the action to take if a match is determined.

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';
const httpRouteActionProperty: appmesh.CfnRoute.HttpRouteActionProperty = {
  weightedTargets: [{
    virtualNode: 'virtualNode',
    weight: 123,

    // the properties below are optional
    port: 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

http_route_action_property = appmesh.CfnRoute.HttpRouteActionProperty(
    weighted_targets=[appmesh.CfnRoute.WeightedTargetProperty(
        virtual_node="virtualNode",
        weight=123,

        # the properties below are optional
        port=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.*;

HttpRouteActionProperty httpRouteActionProperty = HttpRouteActionProperty.builder()
        .weightedTargets(List.of(WeightedTargetProperty.builder()
                .virtualNode("virtualNode")
                .weight(123)

                // the properties below are optional
                .port(123)
                .build()))
        .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;

var httpRouteActionProperty = new HttpRouteActionProperty {
    WeightedTargets = new [] { new WeightedTargetProperty {
        VirtualNode = "virtualNode",
        Weight = 123,

        // the properties below are optional
        Port = 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"

httpRouteActionProperty := &HttpRouteActionProperty{
	WeightedTargets: []interface{}{
		&WeightedTargetProperty{
			VirtualNode: jsii.String("virtualNode"),
			Weight: jsii.Number(123),

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

Properties ​

weightedTargetsIResolvable | IResolvable | CfnRoute.WeightedTargetProperty[]weighted_targetstyping.Union[IResolvable, typing.List[typing.Union[IResolvable, WeightedTargetProperty]]]weightedTargetsIResolvableWeightedTargetsIResolvableWeightedTargetsinterface{} required #
An object that represents the targets that traffic is routed to when a request matches the route.