Interface AddRoutesOptions
- All Superinterfaces:
BatchHttpRouteOptions,software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
AddRoutesOptions.Jsii$Proxy
@Generated(value="jsii-pacmak/1.93.0 (build 1706ca5)",
date="2024-01-03T18:29:21.319Z")
@Stability(Stable)
public interface AddRoutesOptions
extends software.amazon.jsii.JsiiSerializable, BatchHttpRouteOptions
Options for the Route with Integration resource.
Example:
import software.amazon.awscdk.aws_apigatewayv2_authorizers.HttpLambdaAuthorizer;
import software.amazon.awscdk.aws_apigatewayv2_authorizers.HttpLambdaResponseType;
import software.amazon.awscdk.aws_apigatewayv2_integrations.HttpUrlIntegration;
// This function handles your auth logic
Function authHandler;
HttpLambdaAuthorizer authorizer = HttpLambdaAuthorizer.Builder.create("BooksAuthorizer", authHandler)
.responseTypes(List.of(HttpLambdaResponseType.SIMPLE))
.build();
HttpApi api = new HttpApi(this, "HttpApi");
api.addRoutes(AddRoutesOptions.builder()
.integration(new HttpUrlIntegration("BooksIntegration", "https://get-books-proxy.example.com"))
.path("/books")
.authorizer(authorizer)
.build());
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forAddRoutesOptionsstatic final classAn implementation forAddRoutesOptions -
Method Summary
Modifier and TypeMethodDescriptionstatic AddRoutesOptions.Builderbuilder()The list of OIDC scopes to include in the authorization.default IHttpRouteAuthorizerAuthorizer to be associated to these routes.default List<HttpMethod>The HTTP methods to be configured.getPath()The path at which all of these routes are configured.Methods inherited from interface software.amazon.awscdk.services.apigatewayv2.BatchHttpRouteOptions
getIntegrationMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getPath
The path at which all of these routes are configured. -
getAuthorizationScopes
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
Default: - uses defaultAuthorizationScopes if configured on the API, otherwise none.
-
getAuthorizer
Authorizer to be associated to these routes.Use NoneAuthorizer to remove the default authorizer for the api
Default: - uses the default authorizer if one is specified on the HttpApi
-
getMethods
The HTTP methods to be configured.Default: HttpMethod.ANY
-
builder
- Returns:
- a
AddRoutesOptions.BuilderofAddRoutesOptions
-