CfnRouteProps

class aws_cdk.aws_apigatewayv2.CfnRouteProps(*, api_id, route_key, api_key_required=None, authorization_scopes=None, authorization_type=None, authorizer_id=None, model_selection_expression=None, operation_name=None, request_models=None, request_parameters=None, route_response_selection_expression=None, target=None)

Bases: object

Properties for defining a CfnRoute.

Parameters:
  • api_id (str) – The API identifier.

  • route_key (str) – The route key for the route. For HTTP APIs, the route key can be either $default , or a combination of an HTTP method and resource path, for example, GET /pets .

  • api_key_required (Union[bool, IResolvable, None]) – Specifies whether an API key is required for the route. Supported only for WebSocket APIs.

  • authorization_scopes (Optional[Sequence[str]]) – The authorization scopes supported by this route.

  • authorization_type (Optional[str]) – The authorization type for the route. For WebSocket APIs, valid values are NONE for open access, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda authorizer. For HTTP APIs, valid values are NONE for open access, JWT for using JSON Web Tokens, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda authorizer.

  • authorizer_id (Optional[str]) – The identifier of the Authorizer resource to be associated with this route. The authorizer identifier is generated by API Gateway when you created the authorizer.

  • model_selection_expression (Optional[str]) – The model selection expression for the route. Supported only for WebSocket APIs.

  • operation_name (Optional[str]) – The operation name for the route.

  • request_models (Optional[Any]) – The request models for the route. Supported only for WebSocket APIs.

  • request_parameters (Optional[Any]) – The request parameters for the route. Supported only for WebSocket APIs.

  • route_response_selection_expression (Optional[str]) – The route response selection expression for the route. Supported only for WebSocket APIs.

  • target (Optional[str]) – The target for the route.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-route.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_apigatewayv2 as apigatewayv2

# request_models: Any
# request_parameters: Any

cfn_route_props = apigatewayv2.CfnRouteProps(
    api_id="apiId",
    route_key="routeKey",

    # the properties below are optional
    api_key_required=False,
    authorization_scopes=["authorizationScopes"],
    authorization_type="authorizationType",
    authorizer_id="authorizerId",
    model_selection_expression="modelSelectionExpression",
    operation_name="operationName",
    request_models=request_models,
    request_parameters=request_parameters,
    route_response_selection_expression="routeResponseSelectionExpression",
    target="target"
)

Attributes

api_id

The API identifier.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-route.html#cfn-apigatewayv2-route-apiid

api_key_required

Specifies whether an API key is required for the route.

Supported only for WebSocket APIs.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-route.html#cfn-apigatewayv2-route-apikeyrequired

authorization_scopes

The authorization scopes supported by this route.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-route.html#cfn-apigatewayv2-route-authorizationscopes

authorization_type

The authorization type for the route.

For WebSocket APIs, valid values are NONE for open access, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda authorizer. For HTTP APIs, valid values are NONE for open access, JWT for using JSON Web Tokens, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda authorizer.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-route.html#cfn-apigatewayv2-route-authorizationtype

authorizer_id

The identifier of the Authorizer resource to be associated with this route.

The authorizer identifier is generated by API Gateway when you created the authorizer.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-route.html#cfn-apigatewayv2-route-authorizerid

model_selection_expression

The model selection expression for the route.

Supported only for WebSocket APIs.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-route.html#cfn-apigatewayv2-route-modelselectionexpression

operation_name

The operation name for the route.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-route.html#cfn-apigatewayv2-route-operationname

request_models

The request models for the route.

Supported only for WebSocket APIs.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-route.html#cfn-apigatewayv2-route-requestmodels

request_parameters

The request parameters for the route.

Supported only for WebSocket APIs.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-route.html#cfn-apigatewayv2-route-requestparameters

route_key

The route key for the route.

For HTTP APIs, the route key can be either $default , or a combination of an HTTP method and resource path, for example, GET /pets .

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-route.html#cfn-apigatewayv2-route-routekey

route_response_selection_expression

The route response selection expression for the route.

Supported only for WebSocket APIs.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-route.html#cfn-apigatewayv2-route-routeresponseselectionexpression

target

The target for the route.

Link:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-route.html#cfn-apigatewayv2-route-target