Skip to content
v2.278.0

HttpRouteMatchProperty Struct ​

An object that represents the requirements for a route to match HTTP requests for a virtual router.

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 httpRouteMatchProperty: appmesh.CfnRoute.HttpRouteMatchProperty = {
  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',
};
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_match_property = 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"
)
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.*;

HttpRouteMatchProperty httpRouteMatchProperty = 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();
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 httpRouteMatchProperty = 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"
};
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"

httpRouteMatchProperty := &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"),
}

Properties ​

headersoptionalIResolvable | IResolvable | CfnRoute.HttpRouteHeaderProperty[]headersoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, HttpRouteHeaderProperty]]]headersoptionalIResolvableHeadersoptionalIResolvableHeadersoptionalinterface{} #
The client request headers to match on.
methodoptionalstringmethodoptionalstrmethodoptionalStringMethodoptionalstringMethodoptional*string #
The client request method to match on.

Specify only one.

pathoptionalIResolvable | CfnRoute.HttpPathMatchPropertypathoptionaltyping.Union[IResolvable, HttpPathMatchProperty]pathoptionalIResolvablePathoptionalIResolvablePathoptionalinterface{} #
The client request path to match on.
portoptionalnumberportoptionalint | floatportoptionalNumberPortoptionaldoublePortoptional*float64 #
The port number to match on.
prefixoptionalstringprefixoptionalstrprefixoptionalStringPrefixoptionalstringPrefixoptional*string #
Specifies the path to match requests with.
notes

This parameter must always start with / , which by itself matches all requests to the virtual service name. You can also match for path-based routing of requests. For example, if your virtual service name is my-service.local and you want the route to match requests to my-service.local/metrics , your prefix should be /metrics .

queryParametersoptionalIResolvable | IResolvable | CfnRoute.QueryParameterProperty[]query_parametersoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, QueryParameterProperty]]]queryParametersoptionalIResolvableQueryParametersoptionalIResolvableQueryParametersoptionalinterface{} #
The client request query parameters to match on.
schemeoptionalstringschemeoptionalstrschemeoptionalStringSchemeoptionalstringSchemeoptional*string #
The client request scheme to match on.

Specify only one. Applicable only for HTTP2 routes.