Interface ILambdaRestApiProps
- Namespace
- Amazon.CDK.AWS.APIGateway
- Assembly
- Amazon.CDK.AWS.APIGateway.dll
public interface ILambdaRestApiProps : IRestApiProps, IRestApiOptions, IRestApiBaseProps, IResourceOptions
- Inherited Members
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"));
Remarks
ExampleMetadata: infused
Properties
Handler
The default Lambda function that handles all requests from this API.
IFunction Handler { get; }
Property Value
- IFunction
Remarks
This handler will be used as a the default integration for all methods in
this API, unless specified otherwise in addMethod
.
Options
[Obsolete("the `LambdaRestApiProps` now extends `RestApiProps`, so all options are just available here. Note that the options specified in `options` will be overridden by any props specified at the root level.")]
IRestApiProps? Options { get; }
Property Value
Remarks
Default: - no options.
Stability: Deprecated
Proxy
If true, route all requests to the Lambda Function.
bool? Proxy { get; }
Property Value
- bool?
Remarks
If set to false, you will need to explicitly define the API model using
addResource
and addMethod
(or addProxy
).
Default: true