# HttpGatewayRouteProperty

An object that represents an HTTP gateway route.

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## Example

TypeScript:

```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 httpGatewayRouteProperty: appmesh.CfnGatewayRoute.HttpGatewayRouteProperty = {
  action: {
    target: {
      virtualService: {
        virtualServiceName: 'virtualServiceName',
      },

      // the properties below are optional
      port: 123,
    },

    // the properties below are optional
    rewrite: {
      hostname: {
        defaultTargetHostname: 'defaultTargetHostname',
      },
      path: {
        exact: 'exact',
      },
      prefix: {
        defaultPrefix: 'defaultPrefix',
        value: 'value',
      },
    },
  },
  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',
      },
    }],
    hostname: {
      exact: 'exact',
      suffix: 'suffix',
    },
    method: 'method',
    path: {
      exact: 'exact',
      regex: 'regex',
    },
    port: 123,
    prefix: 'prefix',
    queryParameters: [{
      name: 'name',

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

Python:

```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_gateway_route_property = appmesh.CfnGatewayRoute.HttpGatewayRouteProperty(
    action=appmesh.CfnGatewayRoute.HttpGatewayRouteActionProperty(
        target=appmesh.CfnGatewayRoute.GatewayRouteTargetProperty(
            virtual_service=appmesh.CfnGatewayRoute.GatewayRouteVirtualServiceProperty(
                virtual_service_name="virtualServiceName"
            ),

            # the properties below are optional
            port=123
        ),

        # the properties below are optional
        rewrite=appmesh.CfnGatewayRoute.HttpGatewayRouteRewriteProperty(
            hostname=appmesh.CfnGatewayRoute.GatewayRouteHostnameRewriteProperty(
                default_target_hostname="defaultTargetHostname"
            ),
            path=appmesh.CfnGatewayRoute.HttpGatewayRoutePathRewriteProperty(
                exact="exact"
            ),
            prefix=appmesh.CfnGatewayRoute.HttpGatewayRoutePrefixRewriteProperty(
                default_prefix="defaultPrefix",
                value="value"
            )
        )
    ),
    match=appmesh.CfnGatewayRoute.HttpGatewayRouteMatchProperty(
        headers=[appmesh.CfnGatewayRoute.HttpGatewayRouteHeaderProperty(
            name="name",

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

            # the properties below are optional
            match=appmesh.CfnGatewayRoute.HttpQueryParameterMatchProperty(
                exact="exact"
            )
        )]
    )
)
```

Java:

```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.*;

HttpGatewayRouteProperty httpGatewayRouteProperty = HttpGatewayRouteProperty.builder()
        .action(HttpGatewayRouteActionProperty.builder()
                .target(GatewayRouteTargetProperty.builder()
                        .virtualService(GatewayRouteVirtualServiceProperty.builder()
                                .virtualServiceName("virtualServiceName")
                                .build())

                        // the properties below are optional
                        .port(123)
                        .build())

                // the properties below are optional
                .rewrite(HttpGatewayRouteRewriteProperty.builder()
                        .hostname(GatewayRouteHostnameRewriteProperty.builder()
                                .defaultTargetHostname("defaultTargetHostname")
                                .build())
                        .path(HttpGatewayRoutePathRewriteProperty.builder()
                                .exact("exact")
                                .build())
                        .prefix(HttpGatewayRoutePrefixRewriteProperty.builder()
                                .defaultPrefix("defaultPrefix")
                                .value("value")
                                .build())
                        .build())
                .build())
        .match(HttpGatewayRouteMatchProperty.builder()
                .headers(List.of(HttpGatewayRouteHeaderProperty.builder()
                        .name("name")

                        // the properties below are optional
                        .invert(false)
                        .match(HttpGatewayRouteHeaderMatchProperty.builder()
                                .exact("exact")
                                .prefix("prefix")
                                .range(GatewayRouteRangeMatchProperty.builder()
                                        .end(123)
                                        .start(123)
                                        .build())
                                .regex("regex")
                                .suffix("suffix")
                                .build())
                        .build()))
                .hostname(GatewayRouteHostnameMatchProperty.builder()
                        .exact("exact")
                        .suffix("suffix")
                        .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()))
                .build())
        .build();
```

C# / .NET:

```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 httpGatewayRouteProperty = new HttpGatewayRouteProperty {
    Action = new HttpGatewayRouteActionProperty {
        Target = new GatewayRouteTargetProperty {
            VirtualService = new GatewayRouteVirtualServiceProperty {
                VirtualServiceName = "virtualServiceName"
            },

            // the properties below are optional
            Port = 123
        },

        // the properties below are optional
        Rewrite = new HttpGatewayRouteRewriteProperty {
            Hostname = new GatewayRouteHostnameRewriteProperty {
                DefaultTargetHostname = "defaultTargetHostname"
            },
            Path = new HttpGatewayRoutePathRewriteProperty {
                Exact = "exact"
            },
            Prefix = new HttpGatewayRoutePrefixRewriteProperty {
                DefaultPrefix = "defaultPrefix",
                Value = "value"
            }
        }
    },
    Match = new HttpGatewayRouteMatchProperty {
        Headers = new [] { new HttpGatewayRouteHeaderProperty {
            Name = "name",

            // the properties below are optional
            Invert = false,
            Match = new HttpGatewayRouteHeaderMatchProperty {
                Exact = "exact",
                Prefix = "prefix",
                Range = new GatewayRouteRangeMatchProperty {
                    End = 123,
                    Start = 123
                },
                Regex = "regex",
                Suffix = "suffix"
            }
        } },
        Hostname = new GatewayRouteHostnameMatchProperty {
            Exact = "exact",
            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"
            }
        } }
    }
};
```

Golang:

```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"

httpGatewayRouteProperty := &HttpGatewayRouteProperty{
	Action: &HttpGatewayRouteActionProperty{
		Target: &GatewayRouteTargetProperty{
			VirtualService: &GatewayRouteVirtualServiceProperty{
				VirtualServiceName: jsii.String("virtualServiceName"),
			},

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

		// the properties below are optional
		Rewrite: &HttpGatewayRouteRewriteProperty{
			Hostname: &GatewayRouteHostnameRewriteProperty{
				DefaultTargetHostname: jsii.String("defaultTargetHostname"),
			},
			Path: &HttpGatewayRoutePathRewriteProperty{
				Exact: jsii.String("exact"),
			},
			Prefix: &HttpGatewayRoutePrefixRewriteProperty{
				DefaultPrefix: jsii.String("defaultPrefix"),
				Value: jsii.String("value"),
			},
		},
	},
	Match: &HttpGatewayRouteMatchProperty{
		Headers: []interface{}{
			&HttpGatewayRouteHeaderProperty{
				Name: jsii.String("name"),

				// the properties below are optional
				Invert: jsii.Boolean(false),
				Match: &HttpGatewayRouteHeaderMatchProperty{
					Exact: jsii.String("exact"),
					Prefix: jsii.String("prefix"),
					Range: &GatewayRouteRangeMatchProperty{
						End: jsii.Number(123),
						Start: jsii.Number(123),
					},
					Regex: jsii.String("regex"),
					Suffix: jsii.String("suffix"),
				},
			},
		},
		Hostname: &GatewayRouteHostnameMatchProperty{
			Exact: jsii.String("exact"),
			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"),
				},
			},
		},
	},
}
```

## Properties

- `action`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnGatewayRoute.HttpGatewayRouteActionProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appmesh.CfnGatewayRoute.HttpGatewayRouteActionProperty.html) (required) — An object that represents the action to take if a match is determined.

- `match`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnGatewayRoute.HttpGatewayRouteMatchProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appmesh.CfnGatewayRoute.HttpGatewayRouteMatchProperty.html) (required) — An object that represents the criteria for determining a request match.
