java.lang.Object
software.amazon.jsii.JsiiObject
All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:43.220Z") @Stability(Stable) public class CfnRoute extends CfnResource implements IInspectable
A CloudFormation AWS::ApiGatewayV2::Route.

The AWS::ApiGatewayV2::Route resource creates a route for an API.

Example:

 // 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.*;
 Object requestModels;
 Object requestParameters;
 CfnRoute cfnRoute = CfnRoute.Builder.create(this, "MyCfnRoute")
         .apiId("apiId")
         .routeKey("routeKey")
         // the properties below are optional
         .apiKeyRequired(false)
         .authorizationScopes(List.of("authorizationScopes"))
         .authorizationType("authorizationType")
         .authorizerId("authorizerId")
         .modelSelectionExpression("modelSelectionExpression")
         .operationName("operationName")
         .requestModels(requestModels)
         .requestParameters(requestParameters)
         .routeResponseSelectionExpression("routeResponseSelectionExpression")
         .target("target")
         .build();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnRoute

      protected CfnRoute(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnRoute

      protected CfnRoute(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnRoute

      @Stability(Stable) public CfnRoute(@NotNull Construct scope, @NotNull String id, @NotNull CfnRouteProps props)
      Create a new AWS::ApiGatewayV2::Route.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      props -
      • resource properties.
      This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector -
      • tree inspector to collect and process attributes.
      This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrRouteId

      @Stability(Stable) @NotNull public String getAttrRouteId()
      The route ID.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getApiId

      @Stability(Stable) @NotNull public String getApiId()
      The API identifier.
    • setApiId

      @Stability(Stable) public void setApiId(@NotNull String value)
      The API identifier.
    • getRequestModels

      @Stability(Stable) @NotNull public Object getRequestModels()
      The request models for the route.

      Supported only for WebSocket APIs.

    • setRequestModels

      @Stability(Stable) public void setRequestModels(@NotNull Object value)
      The request models for the route.

      Supported only for WebSocket APIs.

    • getRequestParameters

      @Stability(Stable) @NotNull public Object getRequestParameters()
      The request parameters for the route.

      Supported only for WebSocket APIs.

    • setRequestParameters

      @Stability(Stable) public void setRequestParameters(@NotNull Object value)
      The request parameters for the route.

      Supported only for WebSocket APIs.

    • getRouteKey

      @Stability(Stable) @NotNull public String getRouteKey()
      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 .

    • setRouteKey

      @Stability(Stable) public void setRouteKey(@NotNull String value)
      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 .

    • getApiKeyRequired

      @Stability(Stable) @Nullable public Object getApiKeyRequired()
      Specifies whether an API key is required for the route.

      Supported only for WebSocket APIs.

    • setApiKeyRequired

      @Stability(Stable) public void setApiKeyRequired(@Nullable Boolean value)
      Specifies whether an API key is required for the route.

      Supported only for WebSocket APIs.

    • setApiKeyRequired

      @Stability(Stable) public void setApiKeyRequired(@Nullable IResolvable value)
      Specifies whether an API key is required for the route.

      Supported only for WebSocket APIs.

    • getAuthorizationScopes

      @Stability(Stable) @Nullable public List<String> getAuthorizationScopes()
      The authorization scopes supported by this route.
    • setAuthorizationScopes

      @Stability(Stable) public void setAuthorizationScopes(@Nullable List<String> value)
      The authorization scopes supported by this route.
    • getAuthorizationType

      @Stability(Stable) @Nullable public String getAuthorizationType()
      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.

    • setAuthorizationType

      @Stability(Stable) public void setAuthorizationType(@Nullable String value)
      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.

    • getAuthorizerId

      @Stability(Stable) @Nullable public String getAuthorizerId()
      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.

    • setAuthorizerId

      @Stability(Stable) public void setAuthorizerId(@Nullable String value)
      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.

    • getModelSelectionExpression

      @Stability(Stable) @Nullable public String getModelSelectionExpression()
      The model selection expression for the route.

      Supported only for WebSocket APIs.

    • setModelSelectionExpression

      @Stability(Stable) public void setModelSelectionExpression(@Nullable String value)
      The model selection expression for the route.

      Supported only for WebSocket APIs.

    • getOperationName

      @Stability(Stable) @Nullable public String getOperationName()
      The operation name for the route.
    • setOperationName

      @Stability(Stable) public void setOperationName(@Nullable String value)
      The operation name for the route.
    • getRouteResponseSelectionExpression

      @Stability(Stable) @Nullable public String getRouteResponseSelectionExpression()
      The route response selection expression for the route.

      Supported only for WebSocket APIs.

    • setRouteResponseSelectionExpression

      @Stability(Stable) public void setRouteResponseSelectionExpression(@Nullable String value)
      The route response selection expression for the route.

      Supported only for WebSocket APIs.

    • getTarget

      @Stability(Stable) @Nullable public String getTarget()
      The target for the route.
    • setTarget

      @Stability(Stable) public void setTarget(@Nullable String value)
      The target for the route.