Interface LambdaRestApiProps

All Superinterfaces:, ResourceOptions, RestApiBaseProps, RestApiProps
All Known Implementing Classes:

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-24T02:42:33.135Z") @Stability(Stable) public interface LambdaRestApiProps extends, RestApiProps

 Function backend;
 LambdaRestApi api = LambdaRestApi.Builder.create(this, "myapi")
 Resource items = api.root.addResource("items");
 items.addMethod("GET"); // GET /items
 items.addMethod("POST"); // POST /items
 Resource item = items.addResource("{item}");
 item.addMethod("GET"); // GET /items/{item}
 // the default integration for methods is "handler", but one can
 // customize this behavior per method or even a sub path.
 item.addMethod("DELETE", new HttpIntegration(""));
  • Method Details

    • getHandler

      @Stability(Stable) @NotNull IFunction getHandler()
      The default Lambda function that handles all requests from this API.

      This handler will be used as a the default integration for all methods in this API, unless specified otherwise in addMethod.

    • getIntegrationOptions

      @Stability(Stable) @Nullable default LambdaIntegrationOptions getIntegrationOptions()
      Specific Lambda integration options.

      Default: see defaults defined in `LambdaIntegrationOptions`.

    • getProxy

      @Stability(Stable) @Nullable default Boolean getProxy()
      If true, route all requests to the Lambda Function.

      If set to false, you will need to explicitly define the API model using addResource and addMethod (or addProxy).

      Default: true

    • builder

      @Stability(Stable) static LambdaRestApiProps.Builder builder()
      a LambdaRestApiProps.Builder of LambdaRestApiProps