# HttpRouteProps

Properties to initialize a new Route.

Extends: [BatchHttpRouteOptions](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.BatchHttpRouteOptions.html)
Used as props by: [HttpRoute](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.HttpRoute.html)

- Source: [`aws-apigatewayv2/lib/http/route.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-apigatewayv2/lib/http/route.ts#L133)
- Type last changed: v2.235.0 · 15 Jan 2026

## Example

TypeScript:

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

declare const httpApiRef: apigatewayv2.IHttpApiRef;
declare const httpRouteAuthorizer: apigatewayv2.IHttpRouteAuthorizer;
declare const httpRouteIntegration: apigatewayv2.HttpRouteIntegration;
declare const httpRouteKey: apigatewayv2.HttpRouteKey;
const httpRouteProps: apigatewayv2.HttpRouteProps = {
  httpApi: httpApiRef,
  integration: httpRouteIntegration,
  routeKey: httpRouteKey,

  // the properties below are optional
  authorizationScopes: ['authorizationScopes'],
  authorizer: httpRouteAuthorizer,
};
```

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_apigatewayv2 as apigatewayv2

# http_api_ref: apigatewayv2.IHttpApiRef
# http_route_authorizer: apigatewayv2.IHttpRouteAuthorizer
# http_route_integration: apigatewayv2.HttpRouteIntegration
# http_route_key: apigatewayv2.HttpRouteKey

http_route_props = apigatewayv2.HttpRouteProps(
    http_api=http_api_ref,
    integration=http_route_integration,
    route_key=http_route_key,

    # the properties below are optional
    authorization_scopes=["authorizationScopes"],
    authorizer=http_route_authorizer
)
```

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

IHttpApiRef httpApiRef;
IHttpRouteAuthorizer httpRouteAuthorizer;
HttpRouteIntegration httpRouteIntegration;
HttpRouteKey httpRouteKey;

HttpRouteProps httpRouteProps = HttpRouteProps.builder()
        .httpApi(httpApiRef)
        .integration(httpRouteIntegration)
        .routeKey(httpRouteKey)

        // the properties below are optional
        .authorizationScopes(List.of("authorizationScopes"))
        .authorizer(httpRouteAuthorizer)
        .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.Apigatewayv2;

IHttpApiRef httpApiRef;
IHttpRouteAuthorizer httpRouteAuthorizer;
HttpRouteIntegration httpRouteIntegration;
HttpRouteKey httpRouteKey;

var httpRouteProps = new HttpRouteProps {
    HttpApi = httpApiRef,
    Integration = httpRouteIntegration,
    RouteKey = httpRouteKey,

    // the properties below are optional
    AuthorizationScopes = new [] { "authorizationScopes" },
    Authorizer = httpRouteAuthorizer
};
```

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"

var httpApiRef IHttpApiRef
var httpRouteAuthorizer IHttpRouteAuthorizer
var httpRouteIntegration HttpRouteIntegration
var httpRouteKey HttpRouteKey

httpRouteProps := &HttpRouteProps{
	HttpApi: httpApiRef,
	Integration: httpRouteIntegration,
	RouteKey: httpRouteKey,

	// the properties below are optional
	AuthorizationScopes: []*string{
		jsii.String("authorizationScopes"),
	},
	Authorizer: httpRouteAuthorizer,
}
```

## Properties

- `authorizationScopes`: string[] — The list of OIDC scopes to include in the authorization.

  **Default:** no additional authorization scopes

  These scopes will be merged with the scopes from the attached authorizer

- `authorizer`: [IHttpRouteAuthorizer](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.IHttpRouteAuthorizer.html) — Authorizer for a WebSocket API or an HTTP API.

  **Default:** No authorizer

- `httpApi`: [IHttpApiRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.IHttpApiRef.html) (required) — the API the route is associated with.

- `integration`: [HttpRouteIntegration](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.HttpRouteIntegration.html) (required) — The integration to be configured on this route.

- `routeKey`: [HttpRouteKey](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.HttpRouteKey.html) (required) — The key to this route.

  This is a combination of an HTTP method and an HTTP path.
