interface AddRoutesOptions
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Apigatewayv2.AddRoutesOptions |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsapigatewayv2#AddRoutesOptions |
![]() | software.amazon.awscdk.services.apigatewayv2.AddRoutesOptions |
![]() | aws_cdk.aws_apigatewayv2.AddRoutesOptions |
![]() | aws-cdk-lib » aws_apigatewayv2 » AddRoutesOptions |
Options for the Route with Integration resource.
Example
import { HttpUrlIntegration, HttpLambdaIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';
const getBooksIntegration = new HttpUrlIntegration('GetBooksIntegration', 'https://get-books-proxy.example.com');
declare const bookStoreDefaultFn: lambda.Function;
const bookStoreDefaultIntegration = new HttpLambdaIntegration('BooksIntegration', bookStoreDefaultFn);
const httpApi = new apigwv2.HttpApi(this, 'HttpApi');
httpApi.addRoutes({
path: '/books',
methods: [ apigwv2.HttpMethod.GET ],
integration: getBooksIntegration,
});
httpApi.addRoutes({
path: '/books',
methods: [ apigwv2.HttpMethod.ANY ],
integration: bookStoreDefaultIntegration,
});
Properties
Name | Type | Description |
---|---|---|
integration | Http | The integration to be configured on this route. |
path | string | The path at which all of these routes are configured. |
authorization | string[] | The list of OIDC scopes to include in the authorization. |
authorizer? | IHttp | Authorizer to be associated to these routes. |
methods? | Http [] | The HTTP methods to be configured. |
integration
Type:
Http
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:
IHttp
(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:
Http
[]
(optional, default: HttpMethod.ANY)
The HTTP methods to be configured.