Skip to content
v2.278.0

HttpRouteProperty Struct ​

An object that represents an HTTP or HTTP/2 route type.

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 httpRouteProperty: appmesh.CfnRoute.HttpRouteProperty = {
  action: {
    weightedTargets: [{
      virtualNode: 'virtualNode',
      weight: 123,

      // the properties below are optional
      port: 123,
    }],
  },
  match: {
    headers: [{
      name: 'name',

      // the properties below are optional
      invert: false,
      match: {
        exact: 'exact',
        prefix: 'prefix',
        range: {
          end: 123,
          start: 123,
        },
        regex: 'regex',
        suffix: 'suffix',
      },
    }],
    method: 'method',
    path: {
      exact: 'exact',
      regex: 'regex',
    },
    port: 123,
    prefix: 'prefix',
    queryParameters: [{
      name: 'name',

      // the properties below are optional
      match: {
        exact: 'exact',
      },
    }],
    scheme: 'scheme',
  },

  // the properties below are optional
  retryPolicy: {
    maxRetries: 123,
    perRetryTimeout: {
      unit: 'unit',
      value: 123,
    },

    // the properties below are optional
    httpRetryEvents: ['httpRetryEvents'],
    tcpRetryEvents: ['tcpRetryEvents'],
  },
  timeout: {
    idle: {
      unit: 'unit',
      value: 123,
    },
    perRequest: {
      unit: 'unit',
      value: 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_property = appmesh.CfnRoute.HttpRouteProperty(
    action=appmesh.CfnRoute.HttpRouteActionProperty(
        weighted_targets=[appmesh.CfnRoute.WeightedTargetProperty(
            virtual_node="virtualNode",
            weight=123,

            # the properties below are optional
            port=123
        )]
    ),
    match=appmesh.CfnRoute.HttpRouteMatchProperty(
        headers=[appmesh.CfnRoute.HttpRouteHeaderProperty(
            name="name",

            # the properties below are optional
            invert=False,
            match=appmesh.CfnRoute.HeaderMatchMethodProperty(
                exact="exact",
                prefix="prefix",
                range=appmesh.CfnRoute.MatchRangeProperty(
                    end=123,
                    start=123
                ),
                regex="regex",
                suffix="suffix"
            )
        )],
        method="method",
        path=appmesh.CfnRoute.HttpPathMatchProperty(
            exact="exact",
            regex="regex"
        ),
        port=123,
        prefix="prefix",
        query_parameters=[appmesh.CfnRoute.QueryParameterProperty(
            name="name",

            # the properties below are optional
            match=appmesh.CfnRoute.HttpQueryParameterMatchProperty(
                exact="exact"
            )
        )],
        scheme="scheme"
    ),

    # the properties below are optional
    retry_policy=appmesh.CfnRoute.HttpRetryPolicyProperty(
        max_retries=123,
        per_retry_timeout=appmesh.CfnRoute.DurationProperty(
            unit="unit",
            value=123
        ),

        # the properties below are optional
        http_retry_events=["httpRetryEvents"],
        tcp_retry_events=["tcpRetryEvents"]
    ),
    timeout=appmesh.CfnRoute.HttpTimeoutProperty(
        idle=appmesh.CfnRoute.DurationProperty(
            unit="unit",
            value=123
        ),
        per_request=appmesh.CfnRoute.DurationProperty(
            unit="unit",
            value=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.*;

HttpRouteProperty httpRouteProperty = HttpRouteProperty.builder()
        .action(HttpRouteActionProperty.builder()
                .weightedTargets(List.of(WeightedTargetProperty.builder()
                        .virtualNode("virtualNode")
                        .weight(123)

                        // the properties below are optional
                        .port(123)
                        .build()))
                .build())
        .match(HttpRouteMatchProperty.builder()
                .headers(List.of(HttpRouteHeaderProperty.builder()
                        .name("name")

                        // the properties below are optional
                        .invert(false)
                        .match(HeaderMatchMethodProperty.builder()
                                .exact("exact")
                                .prefix("prefix")
                                .range(MatchRangeProperty.builder()
                                        .end(123)
                                        .start(123)
                                        .build())
                                .regex("regex")
                                .suffix("suffix")
                                .build())
                        .build()))
                .method("method")
                .path(HttpPathMatchProperty.builder()
                        .exact("exact")
                        .regex("regex")
                        .build())
                .port(123)
                .prefix("prefix")
                .queryParameters(List.of(QueryParameterProperty.builder()
                        .name("name")

                        // the properties below are optional
                        .match(HttpQueryParameterMatchProperty.builder()
                                .exact("exact")
                                .build())
                        .build()))
                .scheme("scheme")
                .build())

        // the properties below are optional
        .retryPolicy(HttpRetryPolicyProperty.builder()
                .maxRetries(123)
                .perRetryTimeout(DurationProperty.builder()
                        .unit("unit")
                        .value(123)
                        .build())

                // the properties below are optional
                .httpRetryEvents(List.of("httpRetryEvents"))
                .tcpRetryEvents(List.of("tcpRetryEvents"))
                .build())
        .timeout(HttpTimeoutProperty.builder()
                .idle(DurationProperty.builder()
                        .unit("unit")
                        .value(123)
                        .build())
                .perRequest(DurationProperty.builder()
                        .unit("unit")
                        .value(123)
                        .build())
                .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 httpRouteProperty = new HttpRouteProperty {
    Action = new HttpRouteActionProperty {
        WeightedTargets = new [] { new WeightedTargetProperty {
            VirtualNode = "virtualNode",
            Weight = 123,

            // the properties below are optional
            Port = 123
        } }
    },
    Match = new HttpRouteMatchProperty {
        Headers = new [] { new HttpRouteHeaderProperty {
            Name = "name",

            // the properties below are optional
            Invert = false,
            Match = new HeaderMatchMethodProperty {
                Exact = "exact",
                Prefix = "prefix",
                Range = new MatchRangeProperty {
                    End = 123,
                    Start = 123
                },
                Regex = "regex",
                Suffix = "suffix"
            }
        } },
        Method = "method",
        Path = new HttpPathMatchProperty {
            Exact = "exact",
            Regex = "regex"
        },
        Port = 123,
        Prefix = "prefix",
        QueryParameters = new [] { new QueryParameterProperty {
            Name = "name",

            // the properties below are optional
            Match = new HttpQueryParameterMatchProperty {
                Exact = "exact"
            }
        } },
        Scheme = "scheme"
    },

    // the properties below are optional
    RetryPolicy = new HttpRetryPolicyProperty {
        MaxRetries = 123,
        PerRetryTimeout = new DurationProperty {
            Unit = "unit",
            Value = 123
        },

        // the properties below are optional
        HttpRetryEvents = new [] { "httpRetryEvents" },
        TcpRetryEvents = new [] { "tcpRetryEvents" }
    },
    Timeout = new HttpTimeoutProperty {
        Idle = new DurationProperty {
            Unit = "unit",
            Value = 123
        },
        PerRequest = new DurationProperty {
            Unit = "unit",
            Value = 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"

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

				// the properties below are optional
				Port: jsii.Number(123),
			},
		},
	},
	Match: &HttpRouteMatchProperty{
		Headers: []interface{}{
			&HttpRouteHeaderProperty{
				Name: jsii.String("name"),

				// the properties below are optional
				Invert: jsii.Boolean(false),
				Match: &HeaderMatchMethodProperty{
					Exact: jsii.String("exact"),
					Prefix: jsii.String("prefix"),
					Range: &MatchRangeProperty{
						End: jsii.Number(123),
						Start: jsii.Number(123),
					},
					Regex: jsii.String("regex"),
					Suffix: jsii.String("suffix"),
				},
			},
		},
		Method: jsii.String("method"),
		Path: &HttpPathMatchProperty{
			Exact: jsii.String("exact"),
			Regex: jsii.String("regex"),
		},
		Port: jsii.Number(123),
		Prefix: jsii.String("prefix"),
		QueryParameters: []interface{}{
			&QueryParameterProperty{
				Name: jsii.String("name"),

				// the properties below are optional
				Match: &HttpQueryParameterMatchProperty{
					Exact: jsii.String("exact"),
				},
			},
		},
		Scheme: jsii.String("scheme"),
	},

	// the properties below are optional
	RetryPolicy: &HttpRetryPolicyProperty{
		MaxRetries: jsii.Number(123),
		PerRetryTimeout: &DurationProperty{
			Unit: jsii.String("unit"),
			Value: jsii.Number(123),
		},

		// the properties below are optional
		HttpRetryEvents: []*string{
			jsii.String("httpRetryEvents"),
		},
		TcpRetryEvents: []*string{
			jsii.String("tcpRetryEvents"),
		},
	},
	Timeout: &HttpTimeoutProperty{
		Idle: &DurationProperty{
			Unit: jsii.String("unit"),
			Value: jsii.Number(123),
		},
		PerRequest: &DurationProperty{
			Unit: jsii.String("unit"),
			Value: jsii.Number(123),
		},
	},
}

Properties ​

actionIResolvable | CfnRoute.HttpRouteActionPropertyactiontyping.Union[IResolvable, HttpRouteActionProperty]actionIResolvableActionIResolvableActioninterface{} required #
An object that represents the action to take if a match is determined.
An object that represents the criteria for determining a request match.
retryPolicyoptionalIResolvable | CfnRoute.HttpRetryPolicyPropertyretry_policyoptionaltyping.Union[IResolvable, HttpRetryPolicyProperty]retryPolicyoptionalIResolvableRetryPolicyoptionalIResolvableRetryPolicyoptionalinterface{} #
An object that represents a retry policy.
timeoutoptionalIResolvable | CfnRoute.HttpTimeoutPropertytimeoutoptionaltyping.Union[IResolvable, HttpTimeoutProperty]timeoutoptionalIResolvableTimeoutoptionalIResolvableTimeoutoptionalinterface{} #
An object that represents types of timeouts.