HttpRouteProps Struct
Properties to initialize a new Route.
| Source | aws-apigatewayv2/lib/http/route.ts |
|---|---|
| Type last changed |
Example
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
# 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
// 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();
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
};
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
authorizationScopesoptionalstring[]authorization_scopesoptionaltyping.List[str]authorizationScopesoptionalList<String>AuthorizationScopesoptionalstring[]AuthorizationScopesoptional*[]*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
authorizeroptionalIHttpRouteAuthorizerauthorizeroptionalIHttpRouteAuthorizerauthorizeroptionalIHttpRouteAuthorizerAuthorizeroptionalIHttpRouteAuthorizerAuthorizeroptionalIHttpRouteAuthorizer #Authorizer for a WebSocket API or an HTTP API.
Default: No authorizer
httpApiIHttpApiRefhttp_apiIHttpApiRefhttpApiIHttpApiRefHttpApiIHttpApiRefHttpApiIHttpApiRef required #the API the route is associated with.
integrationHttpRouteIntegrationintegrationHttpRouteIntegrationintegrationHttpRouteIntegrationIntegrationHttpRouteIntegrationIntegrationHttpRouteIntegration required #The integration to be configured on this route.
routeKeyHttpRouteKeyroute_keyHttpRouteKeyrouteKeyHttpRouteKeyRouteKeyHttpRouteKeyRouteKeyHttpRouteKey required #The key to this route.
This is a combination of an HTTP method and an HTTP path.