@aws-cdk_aws-apigatewayv2-alpha.AddRoutesOptions

interface AddRoutesOptions ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.Apigatewayv2.Alpha.AddRoutesOptions
Gogithub.com/aws/aws-cdk-go/awscdkapigatewayv2alpha/v2#AddRoutesOptions
Javasoftware.amazon.awscdk.services.apigatewayv2.alpha.AddRoutesOptions
Pythonaws_cdk.aws_apigatewayv2_alpha.AddRoutesOptions
TypeScript (source)@aws-cdk/aws-apigatewayv2-alpha ยป AddRoutesOptions

Options for the Route with Integration resource.

Example

import { HttpLambdaAuthorizer, HttpLambdaResponseType } from '@aws-cdk/aws-apigatewayv2-authorizers-alpha';
import { HttpUrlIntegration } from '@aws-cdk/aws-apigatewayv2-integrations-alpha';

// This function handles your auth logic
declare const authHandler: lambda.Function;

const authorizer = new HttpLambdaAuthorizer('BooksAuthorizer', authHandler, {
  responseTypes: [HttpLambdaResponseType.SIMPLE], // Define if returns simple and/or iam response
});

const api = new apigwv2.HttpApi(this, 'HttpApi');

api.addRoutes({
  integration: new HttpUrlIntegration('BooksIntegration', 'https://get-books-proxy.example.com'),
  path: '/books',
  authorizer,
});

Properties

NameTypeDescription
integration๐Ÿ”นHttpRouteIntegrationThe integration to be configured on this route.
path๐Ÿ”นstringThe path at which all of these routes are configured.
authorizationScopes?๐Ÿ”นstring[]The list of OIDC scopes to include in the authorization.
authorizer?๐Ÿ”นIHttpRouteAuthorizerAuthorizer to be associated to these routes.
methods?๐Ÿ”นHttpMethod[]The HTTP methods to be configured.

integration๐Ÿ”น

Type: HttpRouteIntegration

The integration to be configured on this route.


path๐Ÿ”น

Type: string

The path at which all of these routes are configured.


authorizationScopes?๐Ÿ”น

Type: string[] (optional, default: uses defaultAuthorizationScopes if configured on the API, otherwise none.)

The list of OIDC scopes to include in the authorization.

These scopes will override the default authorization scopes on the gateway. Set to [] to remove default scopes


authorizer?๐Ÿ”น

Type: IHttpRouteAuthorizer (optional, default: uses the default authorizer if one is specified on the HttpApi)

Authorizer to be associated to these routes.

Use NoneAuthorizer to remove the default authorizer for the api


methods?๐Ÿ”น

Type: HttpMethod[] (optional, default: HttpMethod.ANY)

The HTTP methods to be configured.