Interface ILambdaRestApiProps
Inherited Members
Namespace: Amazon.CDK.AWS.APIGateway
Assembly: Amazon.CDK.AWS.APIGateway.dll
Syntax (csharp)
public interface ILambdaRestApiProps : IRestApiProps, IRestApiOptions, IRestApiBaseProps, IResourceOptions
Syntax (vb)
Public Interface ILambdaRestApiProps
Inherits IRestApiProps, IRestApiOptions, IRestApiBaseProps, IResourceOptions
Remarks
ExampleMetadata: infused
Examples
Function backend;
var api = new LambdaRestApi(this, "myapi", new LambdaRestApiProps {
Handler = backend,
Proxy = false
});
var items = api.Root.AddResource("items");
items.AddMethod("GET"); // GET /items
items.AddMethod("POST"); // POST /items
var 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"));
Synopsis
Properties
Handler | The default Lambda function that handles all requests from this API. |
Options | |
Proxy | If true, route all requests to the Lambda Function. |
Properties
Handler
The default Lambda function that handles all requests from this API.
IFunction Handler { get; }
Property Value
Remarks
This handler will be used as a the default integration for all methods in
this API, unless specified otherwise in addMethod
.
Options
virtual IRestApiProps Options { get; }
Property Value
Remarks
Default: - no options.
Stability: Deprecated
Proxy
If true, route all requests to the Lambda Function.
virtual Nullable<bool> Proxy { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
If set to false, you will need to explicitly define the API model using
addResource
and addMethod
(or addProxy
).
Default: true