Class LambdaRestApi

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

@Generated(value="jsii-pacmak/1.94.0 (build b380f01)", date="2024-02-23T02:06:27.518Z") @Stability(Stable) public class LambdaRestApi extends RestApi
Defines an API Gateway REST API with AWS Lambda proxy integration.

Use the proxy property to define a greedy proxy ("{proxy+}") and "ANY" method from the specified path. If not defined, you will need to explicity add resources and methods to the API.

Example:

 Function backend;
 LambdaRestApi api = LambdaRestApi.Builder.create(this, "myapi")
         .handler(backend)
         .proxy(false)
         .build();
 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("http://amazon.com"));
 
  • Constructor Details

    • LambdaRestApi

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

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

      @Stability(Stable) public LambdaRestApi(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull LambdaRestApiProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.