Class LambdaRestApi

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

@Generated(value="jsii-pacmak/1.109.0 (build c221850)", date="2025-03-14T03:24:51.638Z") @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:

 Queue sourceQueue;
 Function fn = Function.Builder.create(this, "MyFunc")
         .handler("index.handler")
         .runtime(Runtime.NODEJS_LATEST)
         .code(Code.fromInline("exports.handler = e => {}"))
         .build();
 LambdaRestApi restApi = LambdaRestApi.Builder.create(this, "MyRestAPI").handler(fn).build();
 ApiGatewayTarget apiTarget = new ApiGatewayTarget(restApi);
 Pipe pipe = Pipe.Builder.create(this, "Pipe")
         .source(new SqsSource(sourceQueue))
         .target(apiTarget)
         .build();
 
  • 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.