Class LambdaRestApi
Defines an API Gateway REST API with AWS Lambda proxy integration.
Inherited Members
Namespace: Amazon.CDK.AWS.APIGateway
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class LambdaRestApi : RestApi, IRestApi, IResource
Syntax (vb)
Public Class LambdaRestApi
Inherits RestApi
Implements IRestApi, IResource
Remarks
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.
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
Constructors
LambdaRestApi(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
LambdaRestApi(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
LambdaRestApi(Construct, String, ILambdaRestApiProps) |
Constructors
LambdaRestApi(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected LambdaRestApi(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
LambdaRestApi(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected LambdaRestApi(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
LambdaRestApi(Construct, String, ILambdaRestApiProps)
public LambdaRestApi(Construct scope, string id, ILambdaRestApiProps props)
Parameters
- scope Constructs.Construct
- id System.String
- props ILambdaRestApiProps
Implements
Constructs.IConstruct
Constructs.IDependable